update dependencies #9
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: 'CI' | |
| on: | |
| push: | |
| # ignore documentation-only changes | |
| paths-ignore: | |
| - '*.md' | |
| pull_request: | |
| paths-ignore: | |
| - '*.md' | |
| workflow_dispatch: {} | |
| # Avoid overlapping runs and cancel in-progress runs on newer commits | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Reduce default permissions for security | |
| permissions: | |
| contents: read | |
| checks: write | |
| actions: read | |
| jobs: | |
| # Build (produce production artifacts) | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [] | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} (with cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: react/package-lock.json | |
| - name: Build | |
| run: rm -rf node_modules && rm -rf package-lock.json && npm install && npm run build | |
| working-directory: react | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: react-build | |
| path: ./react/build/ | |
| # Lint & Audit | |
| audit_lint: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} (with cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: react/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: react | |
| - name: Audit | |
| run: npm run audit | |
| working-directory: react | |
| - name: ESLint | |
| run: npm run lint | |
| working-directory: react | |
| # Unit tests + coverage | |
| unit_tests: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} (with cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: react/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: react | |
| - name: Run unit tests with coverage | |
| run: npm run test:CI | |
| working-directory: react | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./react/reports/coverage/coverage-final.json | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports-coverage | |
| path: ./react/reports/coverage/ | |
| # Playwright E2E | |
| e2e: | |
| runs-on: ubuntu-latest | |
| needs: [unit_tests] | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: react-build | |
| path: ./react/build | |
| - name: Use Node.js ${{ matrix.node-version }} (with cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: react/package-lock.json | |
| - name: Run Playwright tests | |
| run: rm -rf node_modules && rm -rf package-lock.json && npm install && npx playwright install --with-deps && npx playwright test | |
| working-directory: react | |
| - name: Upload playwright reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports-playwright | |
| path: ./react/reports/playwright/ | |
| # Mutation testing | |
| stryker: | |
| if: "github.ref == 'refs/heads/main'" | |
| runs-on: ubuntu-latest | |
| needs: [unit_tests] | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} (with cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: react/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: react | |
| - name: Run Stryker tests | |
| run: npx stryker run | |
| working-directory: react | |
| - name: Upload mutation reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports-mutation | |
| path: ./react/reports/mutation/ |