Repository navigation
fix(ci): validate current workspaces and scoped checks #170
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: backend | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'backend/**' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - 'patches/**' | |
| - '.github/workflows/backend-ci.yml' | |
| - 'scripts/**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build backend | |
| working-directory: ./backend | |
| run: pnpm build | |
| - name: Run source checks | |
| run: pnpm check | |
| - name: Test backend | |
| working-directory: ./backend | |
| run: pnpm test | |
| - name: Cache build artifacts | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ./backend/dist | |
| ./backend/node_modules | |
| key: ${{ runner.os }}-backend-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-backend-${{ hashFiles('**/pnpm-lock.yaml') }}- |