Fix worker thread OOM by removing fake tests and switching to vmThreads #181
Workflow file for this run
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: JavaScript Testing | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - '**/*.js' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'vite.config.js' | |
| - 'vitest.config.js' | |
| - 'cypress.config.js' | |
| - 'tests/**' | |
| - 'cypress/**' | |
| - '.github/workflows/javascript-testing.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - '**.js' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'vite.config.js' | |
| - 'vitest.config.js' | |
| - 'cypress.config.js' | |
| - 'tests/**' | |
| - 'cypress/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Vitest Unit Tests | |
| unit-tests: | |
| name: Unit Tests (Vitest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Vitest unit tests | |
| run: npm run test:coverage | |
| - name: Archive coverage results | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 30 | |
| # Vite Build Test | |
| build-test: | |
| name: Build Test (Vite) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build with Vite | |
| run: npm run build | |
| - name: Check build output | |
| run: | | |
| ls -la dist/ | |
| echo "✅ Build completed successfully" | |
| - name: Archive build artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: build-dist | |
| path: dist/ | |
| retention-days: 30 | |
| # Cypress E2E Tests | |
| e2e-tests: | |
| name: E2E Tests (Cypress) | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: build-dist | |
| path: dist/ | |
| - name: Run Cypress E2E tests | |
| uses: cypress-io/github-action@84d178e4bbce871e23f2ffa3085898cde0e4f0ec # v7.1.2 | |
| with: | |
| start: npm run preview | |
| wait-on: 'http://localhost:4173' | |
| wait-on-timeout: 60 | |
| browser: chrome | |
| - name: Archive Cypress screenshots | |
| if: failure() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: cypress-screenshots | |
| path: cypress/screenshots/ | |
| retention-days: 30 | |
| - name: Archive Cypress videos | |
| if: always() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: cypress-videos | |
| path: cypress/videos/ | |
| retention-days: 30 | |
| # Summary Report | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, build-test, e2e-tests] | |
| if: always() | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Test Results Summary | |
| run: | | |
| echo "## 🧪 Test Results Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Unit Tests (Vitest)" >> $GITHUB_STEP_SUMMARY | |
| echo "Status: ${{ needs.unit-tests.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Build Test (Vite)" >> $GITHUB_STEP_SUMMARY | |
| echo "Status: ${{ needs.build-test.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### E2E Tests (Cypress)" >> $GITHUB_STEP_SUMMARY | |
| echo "Status: ${{ needs.e2e-tests.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ needs.unit-tests.result }}" == "success" ] && \ | |
| [ "${{ needs.build-test.result }}" == "success" ] && \ | |
| [ "${{ needs.e2e-tests.result }}" == "success" ]; then | |
| echo "### ✅ All tests passed!" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "### ❌ Some tests failed" >> $GITHUB_STEP_SUMMARY | |
| fi |