Implement parallel CI workflows for backend and frontend testing #5
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 Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-test.yml' | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-test.yml' | |
| # Cancel in-progress runs for the same workflow and branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Encore Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install Encore CLI | |
| run: | | |
| curl -L https://encore.dev/install.sh | bash | |
| echo "${HOME}/.encore/bin" >> "${GITHUB_PATH}" | |
| - name: Verify Encore installation | |
| run: encore version | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('backend/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| working-directory: ./backend | |
| run: bun install --frozen-lockfile | |
| - name: Run Encore tests | |
| working-directory: ./backend | |
| run: encore test | |
| env: | |
| CI: true | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-test-results | |
| path: backend/test-results/ | |
| retention-days: 7 | |
| if-no-files-found: ignore |