GitHub Actions
Overview
sqry does not currently publish a public composite action at verivus-oss/sqry@v1. Use the public install script in your workflow, then run the normal CLI commands. This keeps CI aligned with the current public release assets documented on the Installation page.
Quick start
Add to .github/workflows/sqry.yml:
name: sqry analysis
on:
pull_request:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install sqry
run: |
curl -fsSL https://raw.githubusercontent.com/verivus-oss/sqry/main/scripts/install.sh \
| bash -s -- --component all
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Build sqry graph
run: sqry index .
- name: Dead code detection
run: sqry --json unused . --scope public --max-results 100 > sqry-unused.json
Examples
Dead code detection with build gate
- name: Dead code detection
run: |
sqry --json unused . --scope public --kind function --max-results 200 > sqry-unused.json
test "$(jq 'length' sqry-unused.json)" -eq 0
Circular dependency check
- name: Circular dependency check
run: |
sqry --json cycles . --type imports --max-results 50 > sqry-cycles.json
test "$(jq 'length' sqry-cycles.json)" -eq 0
Duplicate code detection
- name: Duplicate code detection
run: sqry --json duplicates . --max-results 50 > sqry-duplicates.json
Semantic diff between base and PR head
- name: Semantic diff
run: |
sqry --json diff "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" \
--path . --limit 200 > sqry-diff.json
Codebase statistics
- name: Codebase statistics
run: sqry graph stats --by-language
Multi-platform support
The install script supports Linux and macOS runners and downloads the correct binary:
| Runner | Binary |
|---|---|
ubuntu-latest | sqry-linux-x86_64 |
macos-latest | sqry-macos-arm64 |
macos-13 | sqry-macos-x86_64 |
For Windows runners, use the PowerShell installer:
- name: Install sqry
shell: pwsh
run: irm https://raw.githubusercontent.com/verivus-oss/sqry/main/scripts/install.ps1 | iex
Using with other steps
Most analysis commands support JSON with the global --json flag, so you can consume findings in downstream steps:
- name: Run analysis
id: sqry
run: sqry --json unused . --scope public > sqry-unused.json
- name: Check results
run: |
echo "Found $(jq 'length' sqry-unused.json) unused-symbol groups"