Merge pull request #11 from flyingrobots/dependabot/npm_and_yarn/npm_… #54
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: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| dependency-guard: | |
| name: Dependency Guard + Clean Install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Verify Dependency Integrity (Pre-Install) | |
| run: npm run check:deps | |
| - name: Clean Install | |
| run: npm ci | |
| - name: Verify Dependency Integrity (Post-Install) | |
| run: npm run check:deps | |
| - name: Configure Git User | |
| run: | | |
| # Redirect global git config to a file in /tmp to avoid polluting the host system | |
| # and ensure we have write permissions regardless of the workspace setup. | |
| touch /tmp/.gitconfig_ci | |
| echo "GIT_CONFIG_GLOBAL=/tmp/.gitconfig_ci" >> $GITHUB_ENV | |
| export GIT_CONFIG_GLOBAL="/tmp/.gitconfig_ci" | |
| git config --global user.email "ci@git-cms.local" | |
| git config --global user.name "CI Bot" | |
| git config --global init.defaultBranch main | |
| - name: Run Local Integration Tests | |
| run: npm run test:local | |
| unit-test: | |
| name: Unit Tests (Docker) | |
| runs-on: ubuntu-latest | |
| needs: dependency-guard | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Unit Tests | |
| run: ./test/run-docker.sh | |
| e2e-test: | |
| name: E2E Tests (Playwright) | |
| runs-on: ubuntu-latest | |
| needs: dependency-guard | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.57.0-jammy | |
| steps: | |
| # Git is required in the container to perform plumbing operations during E2E tests. | |
| # Installing it BEFORE checkout ensures actions/checkout performs a real clone. | |
| - name: Install Git | |
| run: apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* | |
| - uses: actions/checkout@v4 | |
| - name: Configure Git User | |
| run: | | |
| # Redirect global git config to a file in /tmp to avoid polluting the host system | |
| # and ensure we have write permissions regardless of the workspace setup. | |
| touch /tmp/.gitconfig_ci | |
| echo "GIT_CONFIG_GLOBAL=/tmp/.gitconfig_ci" >> $GITHUB_ENV | |
| export GIT_CONFIG_GLOBAL="/tmp/.gitconfig_ci" | |
| git config --global user.email "ci@git-cms.local" | |
| git config --global user.name "CI Bot" | |
| git config --global init.defaultBranch main | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Run Playwright Tests | |
| run: npm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |