-
Notifications
You must be signed in to change notification settings - Fork 50
ci: add GitHub Actions workflow for Zig tests #193
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4ccf7bf
ci: add GitHub Actions workflow for Zig tests
unliftedq 472cdd6
Merge branch 'main' of https://github.com/unliftedq/codedb into add-t…
unliftedq 8bd7f19
clean unexpected changes.
unliftedq 1f4b49d
fix: add missing newline at end of file in SparseNgramIndex
unliftedq 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: zig-tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| ZIG_VERSION: 0.15.2 | ||
|
|
||
| jobs: | ||
| test: | ||
| name: test-${{ matrix.name }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: ubuntu | ||
| runner: ubuntu-24.04 | ||
| zig_archive: zig-x86_64-linux-0.15.2.tar.xz | ||
| zig_dir: zig-x86_64-linux-0.15.2 | ||
| - name: macos | ||
| runner: macos-14 | ||
| zig_archive: zig-aarch64-macos-0.15.2.tar.xz | ||
| zig_dir: zig-aarch64-macos-0.15.2 | ||
| - name: windows | ||
| runner: windows-2022 | ||
| zig_archive: zig-x86_64-windows-0.15.2.zip | ||
| zig_dir: zig-x86_64-windows-0.15.2 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Zig | ||
| if: runner.os != 'Windows' | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| curl -L "https://ziglang.org/download/${ZIG_VERSION}/${{ matrix.zig_archive }}" -o zig.tar.xz | ||
| tar -xf zig.tar.xz | ||
| echo "$PWD/${{ matrix.zig_dir }}" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Install Zig | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| Invoke-WebRequest -Uri "https://ziglang.org/download/$env:ZIG_VERSION/${{ matrix.zig_archive }}" -OutFile zig.zip | ||
| Expand-Archive -Path zig.zip -DestinationPath . | ||
| Add-Content -Path $env:GITHUB_PATH -Value (Join-Path $PWD '${{ matrix.zig_dir }}') | ||
|
|
||
| - name: Run tests | ||
| run: zig build test | ||
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
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.
In
.github/workflows/zig-tests.yml(checked theInstall Zigsteps for both non-Windows and Windows), the workflow downloads Zig archives directly from the network and immediately extracts/runs them without any checksum or signature verification. This creates a supply-chain risk: if the download endpoint or transit path is compromised, attacker-controlled binaries can execute in CI (includingpushruns where secrets may be present). Add an integrity check (e.g., pinned SHA-256 per archive/version, or verified signature) before extraction in both install branches.Useful? React with 👍 / 👎.