Repository navigation
fix: make editor and deployment feedback truthful #168
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/**' | |
| - 'codefox-common/**' | |
| - '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: '18' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| 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 --no-frozen-lockfile | |
| - name: Build codefox-common | |
| working-directory: ./codefox-common | |
| run: pnpm build | |
| - 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') }}- |