|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + checks: write |
| 11 | + actions: read |
| 12 | + pull-requests: write |
| 13 | + |
| 14 | +env: |
| 15 | + NODE_VERSION: "24" |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-and-test: |
| 19 | + name: Build & Test |
| 20 | + timeout-minutes: 15 |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout Code |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + |
| 29 | + - name: Setup Node.js |
| 30 | + uses: actions/setup-node@v4 |
| 31 | + with: |
| 32 | + node-version: ${{ env.NODE_VERSION }} |
| 33 | + |
| 34 | + - name: Enable Corepack (Yarn Berry) |
| 35 | + run: corepack enable |
| 36 | + |
| 37 | + - name: Setup Yarn Berry |
| 38 | + run: yarn set version 4.12.0 |
| 39 | + |
| 40 | + - name: Restore Yarn Cache |
| 41 | + uses: actions/cache@v4 |
| 42 | + with: |
| 43 | + path: | |
| 44 | + .yarn/cache |
| 45 | + .yarn/unplugged |
| 46 | + .yarn/build-state.yml |
| 47 | + .pnp.cjs |
| 48 | + key: yarn-${{runner.os}}-${{hashFiles('**/yarn.lock')}} |
| 49 | + restore-keys: yarn-${{runner.os}}- |
| 50 | + |
| 51 | + - name: Install Dependencies (Yarn Berry) |
| 52 | + run: yarn install --immutable |
| 53 | + |
| 54 | + - name: Restore Turborepo Cache |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: .turbo |
| 58 | + key: turbo-${{runner.os}}-${{hashFiles('turbo.json', 'package.json', '**/package.json')}} |
| 59 | + restore-keys: turbo-${{runner.os}}- |
| 60 | + |
| 61 | + - name: Run Typecheck |
| 62 | + run: yarn typecheck |
| 63 | + |
| 64 | + - name: Run Lint |
| 65 | + run: yarn lint |
| 66 | + |
| 67 | + - name: Run Tests |
| 68 | + run: yarn test |
| 69 | + |
| 70 | + - name: Report Test Logs |
| 71 | + uses: dorny/test-reporter@v1 |
| 72 | + if: (!cancelled()) |
| 73 | + with: |
| 74 | + name: Test Logs |
| 75 | + path: "**/.coverage/report.xml" |
| 76 | + reporter: java-junit |
| 77 | + |
| 78 | + - name: Upload Test Artifacts |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + if: (!cancelled()) |
| 81 | + with: |
| 82 | + name: Test Reports |
| 83 | + path: | |
| 84 | + **/.coverage/report.xml |
| 85 | + **/coverage/**/* |
| 86 | + retention-days: 7 |
| 87 | + |
| 88 | + - name: Publish Test Results |
| 89 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 90 | + if: (!cancelled()) |
| 91 | + with: |
| 92 | + files: "**/.coverage/report.xml" |
0 commit comments