Repository navigation
Run the suites on pull requests, four shards at a time #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c3497ea
Run the suites on pull requests, four shards at a time
necessarylion 4d24934
Run the browser tests in the image that already has the browsers
necessarylion 6cbd1f1
Split the workflow in two: one tests, one ships
necessarylion 5f56fe8
Give the Playwright container the unzip that setup-bun needs
necessarylion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Tests | ||
|
|
||
| # Everything that says whether a change is sound. A pull request is where it | ||
| # runs; by the time a commit reaches main it has already passed, and the push | ||
| # only builds and deploys (`docker-publish.yml`). | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - run: bun install --frozen-lockfile | ||
| - run: bun run typecheck | ||
|
|
||
| test: | ||
| name: Test (shard ${{ matrix.shard }}/4) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| shard: [1, 2, 3, 4] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - run: bun install --frozen-lockfile | ||
| # One shard holds the end-to-end suite, which starts the real server on | ||
| # port 8899 and plays a full game between two WebSocket clients. Shards | ||
| # get a runner each, so that fixed port is never contended. | ||
| - run: bunx vitest run --shard=${{ matrix.shard }}/4 | ||
|
|
||
| e2e: | ||
| name: Browser tests (shard ${{ matrix.shard }}/4) | ||
| runs-on: ubuntu-latest | ||
| # Ships the browsers and their system libraries, so there is nothing to | ||
| # download. The tag has to match the pinned `@playwright/test` exactly — | ||
| # the image holds the browser builds for that one version. | ||
| container: mcr.microsoft.com/playwright:v1.62.1-noble | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| shard: [1, 2, 3, 4] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| # The image is built for Node, and `setup-bun` unpacks a zip. | ||
| - run: apt-get update && apt-get install -y --no-install-recommends unzip | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - run: bun install --frozen-lockfile | ||
| # Playwright starts the app itself (`bun run dev`: Vite plus the game server). | ||
| - run: bunx playwright test --shard=${{ matrix.shard }}/4 | ||
|
|
||
| - if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report-${{ matrix.shard }} | ||
| path: playwright-report/ | ||
| retention-days: 7 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,6 @@ dist-server/ | |
| .DS_Store | ||
| *.log | ||
| .vite/ | ||
| test-results/ | ||
| playwright-report/ | ||
| blob-report/ | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: necessarylion/boardgames
Length of output: 4151
Sensitive Data Exposure (CWE-522): Insufficiently Protected Credentials
Reachability: External · Exploitability: Moderate
Disable checkout credential persistence.
Set
persist-credentials: falseon all threeactions/checkout@v4steps unless authenticated Git operations are required.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 1-68: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 12-20: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools