Merge pull request #112 from localnerve/rc-2.10.19 #369
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: Verify | |
| on: | |
| push: | |
| branches: [ main, stage ] | |
| pull_request: | |
| branches: [ main, stage ] | |
| env: | |
| NODE_VERSION: '24.18.0' | |
| REPORT_ARTIFACTS: 'false' | |
| jobs: | |
| build_verify: | |
| runs-on: ubuntu-24.04 | |
| name: 'Build, verify, and cache' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Node with npm cache | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install Npm Dependencies | |
| run: npm ci | |
| - name: Cache Playwright Browser Binaries | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright Browsers (if not cached) | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install | |
| - name: Run Linter | |
| run: npm run lint | |
| - name: Check Production Build | |
| run: npm run build | |
| - name: Archive Build Stats | |
| if: success() && env.REPORT_ARTIFACTS == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: jam-build-stats | |
| overwrite: true | |
| compresion-level: 9 | |
| path: ./stats/ | |
| - name: Build Docker Image | |
| run: npm run test:build # builds jam-build-test:latest | |
| - name: Export Docker Image | |
| run: docker save jam-build-test:latest -o jam-build-test.tar | |
| - name: Upload Docker Image Artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: docker-image | |
| overwrite: true | |
| path: jam-build-test.tar | |
| browser_tests: | |
| needs: build_verify | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Note: WebKit is tested locally on macOS due to GitHub Actions networking limitations | |
| # with TestContainers. See docs/testing.md for details. | |
| # Note2: Firefox started failing only when run with chromium. Moving to only chromium matrix. Paid plan? | |
| # label: ['webkit', 'firefox', 'chromium'] | |
| # label: ['firefox', 'chromium'] | |
| label: ['chromium'] | |
| os: ['ubuntu-24.04'] | |
| runs-on: ${{ matrix.os }} | |
| name: 'Test ${{ matrix.label }} browser on ${{ matrix.os }}' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Node with npm cache | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install Npm Dependencies | |
| run: npm ci | |
| - name: Cache Playwright Browser Binaries | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright Browsers (if not cached) | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install | |
| - name: Set Playwright Browser Path | |
| run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/ms-playwright" >> $GITHUB_ENV | |
| - name: Install Playwright System Dependencies | |
| run: npx playwright install-deps | |
| - name: Download Docker Image Artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: docker-image | |
| - name: Load Docker Image | |
| run: docker load -i jam-build-test.tar | |
| - name: Test ${{ matrix.label }} | |
| run: npm run test:${{ matrix.label }} | |
| - name: Archive Test Reports | |
| if: success() && matrix.label == 'chromium' && env.REPORT_ARTIFACTS == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: test-reports | |
| overwrite: true | |
| compresion-level: 9 | |
| path: | | |
| ./test-results/coverage/coverage-mutation-tests-0/ | |
| ./test-results/audits/ | |
| ./coverage/ | |
| !./coverage/**/tmp | |
| cleanup: | |
| runs-on: ubuntu-24.04 | |
| needs: browser_tests | |
| if: always() | |
| steps: | |
| - name: Delete Test Docker Image | |
| uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0 | |
| with: | |
| name: docker-image | |
| failOnError: false |