feat: add GitHub Actions for CI verification workflow#5
feat: add GitHub Actions for CI verification workflow#5
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces GitHub Actions integration for verilib-cli, enabling Verus projects to integrate verification workflows into their CI/CD pipelines. The implementation provides a composite action with two modes (check and generate) and a reusable workflow that automatically selects the appropriate mode based on the triggering event. The design is well-documented with comprehensive rationale and acknowledges that the deploy functionality is not yet available.
Changes:
- Added composite GitHub Action supporting check mode (PR validation) and generate mode (full pipeline execution)
- Created reusable workflow for easy integration into Verus projects
- Documented design decisions, architecture, and implementation status
- Added placeholder for future deploy action (pending CLI command integration)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 27 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/GITHUB_ACTIONS_DESIGN.md | Comprehensive design document explaining architecture decisions, workflow patterns, and implementation status |
| action/action.yml | Main composite action with auto-detection of versions, tool installation, and dual-mode operation |
| action/README.md | User-facing documentation with usage examples and input/output specifications |
| .github/workflows/verilib-verify.yml | Reusable workflow template for external Verus projects with automatic mode selection |
| action/deploy/README.md | Placeholder documentation for future deploy action functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f8ff36 to
7f94348
Compare
Add reusable workflow and composite action for integrating verilib verification into Verus projects' CI pipelines. New files: - action/action.yml: Main action with check/generate modes - action/README.md: Action documentation - action/deploy/README.md: Placeholder for future deploy action - .github/workflows/verilib-verify.yml: Reusable workflow - docs/GITHUB_ACTIONS_DESIGN.md: Design rationale Usage in any Verus project: uses: beneficial-ai-foundation/verilib-cli/.github/workflows/verilib-verify.yml@v1 On PR: runs --check-only validation On merge to main: runs full pipeline, uploads artifacts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The .verilib directory is hidden (starts with dot) and upload-artifact@v4 defaults to include-hidden-files: false, causing the upload to fail silently. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Function signatures may contain characters like < and > that are invalid for GitHub artifact paths. Create a tar.gz archive of the .verilib directory and provide it as a new output (results-archive). - Add results-archive output to action - Update workflows to use archive for uploads - Update README with guidance on using archive Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8513646 to
0497979
Compare
Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove trailing whitespace throughout action.yml - Add cache checks for probe-verus and verilib-cli (skip cargo install --force when already cached, matching verus-analyzer/scip) - Add error checking after uv installation Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot Review TriageFixed (commit d423785)
Already addressed in prior commits
Won't fix (incorrect or not applicable)
|
Add a separate composite action and reusable workflow for pure Rust (non-Verus) projects that runs `verilib-cli atomize` with rust-analyzer. New files: - action/rust/action.yml: composite action (stable Rust, rust-analyzer, scip, probe-verus, verilib-cli) - action/rust/README.md: documentation - .github/workflows/verilib-atomize.yml: reusable workflow with optional deploy via reclone Closes #38 Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Manual workflow_dispatch to test if VERRILIB_CLI_AUTH_KEY works for verilib-cli reclone. Remove once testing is complete. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitHub Actions expressions don't support the ternary operator (? :). Use the && / || short-circuit pattern instead. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Local action references (uses: ./action) resolve to the caller's workspace, not the reusable workflow's repository. Use fully qualified references so the actions are downloaded from verilib-cli regardless of which repo calls the workflow. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allow callers to override the auto-detected mode (generate vs check). Default remains auto-detect: generate on push to main/master, check otherwise. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Manual triggers (workflow_dispatch) should also run the deploy step when deploy-enabled is true, not just pushes to main/master. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
verilib-cli create generates tracked_functions.csv via probe-verus; it does not require a pre-existing CSV file. Remove the check that blocked generate mode and the now-unused functions-to-track input. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot Review Triage (Rounds 3–5)Fixed (this commit)
Won't fix (incorrect or not applicable)
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a33a45f to
7f15e2c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Deploy to verilib backend | ||
| # NOTE: Update ref when tagging a release (e.g., @v1) | ||
| uses: beneficial-ai-foundation/verilib-cli/action/deploy@main | ||
| with: | ||
| api-key: ${{ secrets.VERILIB_API_KEY }} | ||
| repo-id: ${{ inputs.repo-id }} |
There was a problem hiding this comment.
The deploy step here also uses @main, which defeats pinning for consumers of the reusable workflow. Please pin this to the same ref as the workflow release (e.g., @v1) or keep it otherwise in lockstep with the workflow ref.
| # If not found in root, search subdirectories (workspace members) | ||
| if [ -z "$METADATA" ]; then | ||
| echo "No verus metadata in root Cargo.toml, searching subdirectories..." | ||
| for toml in "$PROJECT_PATH"/*/Cargo.toml; do | ||
| if [ -f "$toml" ]; then | ||
| METADATA=$(awk '/^\[package.metadata.verus\]/{flag=1;next}/^\[.*\]/{flag=0}flag' "$toml") | ||
| if [ -n "$METADATA" ]; then | ||
| CARGO_TOML="$toml" | ||
| echo "Found verus metadata in $CARGO_TOML" | ||
| break | ||
| fi | ||
| fi | ||
| done |
There was a problem hiding this comment.
The Cargo.toml metadata discovery only checks the root and one level of subdirectories ($PROJECT_PATH/*/Cargo.toml), but many workspaces nest members deeper (e.g., crates/foo/Cargo.toml). This can incorrectly error even when [package.metadata.verus] exists. Consider using find (bounded depth) or parsing the workspace members list to locate the correct Cargo.toml reliably.
| run: | | ||
| if command -v probe-verus &> /dev/null; then | ||
| echo "probe-verus already installed (from cache)" | ||
| probe-verus --version | ||
| else | ||
| echo "Installing probe-verus..." | ||
| cargo install --git https://github.com/Beneficial-AI-Foundation/probe-verus | ||
| probe-verus --version || echo "probe-verus installed" | ||
| fi |
There was a problem hiding this comment.
probe-verus is installed from a moving git target (cargo install --git ...) and is then reused from ~/.cargo/bin if present. This can produce non-reproducible runs where a workflow pinned to a tag ends up using whatever probe-verus happened to be cached. Pin the install to a specific ref/tag/sha (and incorporate it into the cache key) or add a version check + reinstall when it doesn’t match the expected version.
| run: | | |
| if command -v probe-verus &> /dev/null; then | |
| echo "probe-verus already installed (from cache)" | |
| probe-verus --version | |
| else | |
| echo "Installing probe-verus..." | |
| cargo install --git https://github.com/Beneficial-AI-Foundation/probe-verus | |
| probe-verus --version || echo "probe-verus installed" | |
| fi | |
| env: | |
| PROBE_VERUS_VERSION: "0.1.0" | |
| run: | | |
| echo "Expected probe-verus version: $PROBE_VERUS_VERSION" | |
| if command -v probe-verus &> /dev/null; then | |
| INSTALLED_PROBE_VERUS_VERSION=$(probe-verus --version | awk '{print $NF}') | |
| echo "probe-verus already installed (from cache): $INSTALLED_PROBE_VERUS_VERSION" | |
| if [ "$INSTALLED_PROBE_VERUS_VERSION" != "$PROBE_VERUS_VERSION" ]; then | |
| echo "probe-verus version mismatch (expected $PROBE_VERUS_VERSION, found $INSTALLED_PROBE_VERUS_VERSION); reinstalling..." | |
| cargo install --git https://github.com/Beneficial-AI-Foundation/probe-verus --tag "v$PROBE_VERUS_VERSION" --force | |
| else | |
| echo "probe-verus version matches expected version ($PROBE_VERUS_VERSION)" | |
| fi | |
| else | |
| echo "Installing probe-verus..." | |
| cargo install --git https://github.com/Beneficial-AI-Foundation/probe-verus --tag "v$PROBE_VERUS_VERSION" | |
| fi | |
| probe-verus --version || echo "probe-verus installed" |
| # Step 4: Install probe-verus | ||
| - name: Install probe-verus | ||
| shell: bash | ||
| run: | | ||
| if command -v probe-verus &> /dev/null; then | ||
| echo "probe-verus already installed (from cache)" | ||
| probe-verus --version | ||
| else | ||
| echo "Installing probe-verus..." | ||
| cargo install --git https://github.com/Beneficial-AI-Foundation/probe-verus | ||
| probe-verus --version || echo "probe-verus installed" | ||
| fi |
There was a problem hiding this comment.
This action installs probe-verus from an unpinned git source and then skips installation if it’s already present in the cached ~/.cargo/bin. That can make runs non-reproducible (especially when consumers pin the action version) and can lead to subtle incompatibilities. Pin to a specific ref/tag/sha (and include it in the cache key) or check the installed version and force reinstall when it differs.
| # Step 6: Install verilib-cli | ||
| - name: Install verilib-cli | ||
| shell: bash | ||
| run: | | ||
| if command -v verilib-cli &> /dev/null; then | ||
| echo "verilib-cli already installed (from cache)" | ||
| verilib-cli --version | ||
| else | ||
| echo "Installing verilib-cli..." | ||
| cargo install --git https://github.com/Beneficial-AI-Foundation/verilib-cli | ||
| verilib-cli --version || echo "verilib-cli installed" | ||
| fi |
There was a problem hiding this comment.
verilib-cli is installed from the repo’s default branch via cargo install --git ...verilib-cli and then reused from cache if present. This breaks version pinning: a workflow/action pinned to a tag/sha can still execute a different verilib-cli than intended (or a stale cached one). Prefer installing from the action checkout (via $GITHUB_ACTION_PATH) or pin the git ref/tag/sha explicitly and ensure the cache key enforces that version.
| # Step 4: Install verilib-cli | ||
| - name: Install verilib-cli | ||
| shell: bash | ||
| run: | | ||
| if command -v verilib-cli &> /dev/null; then | ||
| echo "verilib-cli already installed (from cache)" | ||
| else | ||
| echo "Installing verilib-cli..." | ||
| cargo install --git https://github.com/Beneficial-AI-Foundation/verilib-cli | ||
| fi | ||
| verilib-cli --version || echo "verilib-cli installed" | ||
|
|
There was a problem hiding this comment.
Same versioning/reproducibility concern as the other actions: verilib-cli is installed from an unpinned git source and then reused if present in cached ~/.cargo/bin, which can cause deploy runs to use a different CLI version than the action/workflow version a consumer pinned. Prefer installing from the action’s own checkout (via $GITHUB_ACTION_PATH) or pin the git ref/tag/sha and make the cache key include it (or force reinstall when mismatched).
| - name: Deploy to verilib backend | ||
| # NOTE: Update ref when tagging a release (e.g., @v1) | ||
| uses: beneficial-ai-foundation/verilib-cli/action/deploy@main | ||
| with: | ||
| api-key: ${{ secrets.VERILIB_API_KEY }} | ||
| repo-id: ${{ inputs.repo-id }} |
There was a problem hiding this comment.
Same issue as the verify job: the deploy job uses beneficial-ai-foundation/verilib-cli/action/deploy@main, so consumers pinning this reusable workflow to a tag/sha will still execute whatever is currently on main. Please pin this to the same ref as the reusable workflow release (e.g., @v1) or otherwise keep the action reference in lockstep with the workflow ref.
probe-verus v4.0.0 renamed the `verify` subcommand to `extract`. Update the subprocess invocation, mock test helper, and docs to match. Made-with: Cursor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Add reusable GitHub Actions workflows and composite actions for integrating verilib into any project's CI pipeline:
create->atomize->specify->verify) with check/generate modesatomizewithrust-analyzer)verilib-cli recloneto trigger backend re-processingFiles
action/action.ymlaction/rust/action.ymlaction/deploy/action.yml.github/workflows/verilib-verify.yml.github/workflows/verilib-atomize.ymldocs/GITHUB_ACTIONS_DESIGN.mdQuick start
Verus project
See
action/README.mdfor full details on modes, inputs, outputs, and what commands run.Pure Rust project
See
action/rust/README.mdfor full details.Related issues
verilib-cli deployto replacereclonestopgap