E2e tests #234
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: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| test: | |
| name: Testing on ${{ matrix.platform }} with Node.js ${{ matrix.node-version }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories | |
| # macos-13 = intel | |
| # macos-14+ = M1 (arm) | |
| platform: [ubuntu-24.04, macos-13, macos-15, windows-2025] | |
| node-version: [22] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js ${{ matrix.node-version }} environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run linter | |
| run: pnpm run lint | |
| # - name: Run typecheck | |
| # run: pnpm run check-types | |
| # - name: Identify misconfigurations and security anti-patterns | |
| # uses: doyensec/electronegativity-action@v2 | |
| # - name: Upload report | |
| # uses: github/codeql-action/upload-sarif@v1 | |
| # with: | |
| # sarif_file: ../electronegativity_results | |
| - name: Build | |
| run: pnpm run build | |
| - name: Run E2E tests (Linux) | |
| if: runner.os == 'Linux' | |
| run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pnpm run test | |
| - name: Run E2E tests (macOS/Windows) | |
| if: runner.os != 'Linux' | |
| run: pnpm run test | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-${{ matrix.platform }} | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test-results-${{ matrix.platform }} | |
| path: test-results/ | |
| retention-days: 7 | |
| # Uncomment if necessary | |
| # For example to inspect the build applications | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact_${{ matrix.platform }} | |
| path: | | |
| dist/*.exe | |
| dist/*.dmg | |
| dist/*.zip | |
| dist/*.AppImage | |
| dist/*.snap | |
| dist/*.deb | |
| if-no-files-found: error |