Repository navigation
Docs: show the bare Stackyard mark above the README title #1323
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: End-to-end | |
| # A required check. Do not filter it by path. A required check that never starts | |
| # blocks a pull request forever. | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| # Called by the release workflow. | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| jobs: | |
| e2e: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: '24' | |
| - name: Install dev tooling | |
| run: npm ci | |
| - name: Cache Playwright browsers | |
| id: browsers | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| # Any dev-dependency bump changes the key, so fall back to the last | |
| # browser set rather than re-downloading all of them; the install step | |
| # below fetches whatever that set is missing. | |
| restore-keys: playwright-${{ runner.os }}- | |
| - name: Install browsers | |
| run: npx playwright install --with-deps chromium webkit | |
| # The image that ships, so nginx and its headers are part of what is | |
| # tested. A bug this project has already had, an inline handler refused by | |
| # the Content-Security-Policy, is invisible without them. | |
| - name: Build the image | |
| run: docker build -t stackyard:e2e . | |
| - name: Start the container | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/data" "$RUNNER_TEMP/icons" | |
| chmod 777 "$RUNNER_TEMP/data" "$RUNNER_TEMP/icons" | |
| docker run -d --name stackyard-e2e \ | |
| -p 8730:80 \ | |
| -v "$RUNNER_TEMP/data:/data" \ | |
| -v "$RUNNER_TEMP/icons:/icons" \ | |
| stackyard:e2e | |
| for i in $(seq 1 60); do | |
| if curl -fsS http://127.0.0.1:8730/health >/dev/null 2>&1; then echo "up after ${i}s"; exit 0; fi | |
| sleep 1 | |
| done | |
| echo "::error::the container never became healthy" | |
| docker logs stackyard-e2e | |
| exit 1 | |
| - name: Run the specs | |
| run: npx playwright test | |
| env: | |
| BASE_URL: http://127.0.0.1:8730 | |
| - name: Container logs on failure | |
| if: failure() | |
| run: docker logs stackyard-e2e | |
| - name: Upload the report | |
| if: failure() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 | |
| - name: Stop the container | |
| if: always() | |
| run: docker rm -f stackyard-e2e || true |