Skip to content

deps(cli)(deps): bump the rust-cli group #175

deps(cli)(deps): bump the rust-cli group

deps(cli)(deps): bump the rust-cli group #175

Workflow file for this run

name: Solana Program

Check failure on line 1 in .github/workflows/solana-program.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/solana-program.yml

Invalid workflow file

(Line: 43, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('programs/signia-registry/Anchor.toml') != '', (Line: 157, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('programs/signia-registry/Cargo.toml') != ''
on:
push:
branches: ["main"]
paths:
- "programs/signia-registry/**"
- ".github/workflows/solana-program.yml"
- "Cargo.lock"
- "rust-toolchain.toml"
pull_request:
branches: ["main"]
paths:
- "programs/signia-registry/**"
- ".github/workflows/solana-program.yml"
- "Cargo.lock"
- "rust-toolchain.toml"
workflow_dispatch:
concurrency:
group: solana-program-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SOLANA_VERSION: "stable"
# Anchor is installed via AVM; "latest" is generally fine for CI unless you want to pin.
ANCHOR_VERSION: "latest"
NODE_VERSION: "20"
PNPM_VERSION: "9"
# Faster, less noisy logs
RUST_LOG: "info"
jobs:
anchor-test:
name: Anchor build + test (local validator)
runs-on: ubuntu-latest
# Only run if the program exists
if: ${{ hashFiles('programs/signia-registry/Anchor.toml') != '' }}
defaults:
run:
shell: bash
working-directory: programs/signia-registry
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
libssl-dev \
libudev-dev \
clang \
cmake
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Install program JS dependencies (if any)
run: |
set -euo pipefail
if [ -f package.json ]; then
pnpm install --frozen-lockfile || pnpm install
else
echo "No package.json found; skipping JS deps."
fi
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: |
programs/signia-registry -> target
- name: Install Solana CLI
run: |
set -euo pipefail
sh -c "$(curl -sSfL https://release.solana.com/${SOLANA_VERSION}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
solana --version
solana config set --url localhost
- name: Cache Solana CLI
uses: actions/cache@v4
with:
path: |
~/.local/share/solana
key: solana-${{ runner.os }}-${{ env.SOLANA_VERSION }}
- name: Install Anchor (AVM)
run: |
set -euo pipefail
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install ${ANCHOR_VERSION}
avm use ${ANCHOR_VERSION}
anchor --version
- name: Print tool versions
run: |
set -euo pipefail
echo "Rust:"
rustc -V
cargo -V
echo "Solana:"
solana --version
echo "Anchor:"
anchor --version
echo "Node:"
node -v
echo "pnpm:"
pnpm -v
- name: Anchor build
run: |
set -euo pipefail
anchor build
- name: Anchor test (local validator)
run: |
set -euo pipefail
# Anchor will start a local validator automatically.
# If your tests require custom config, add flags here.
anchor test
- name: Upload program artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: signia-registry-program-artifacts
path: |
programs/signia-registry/target/deploy
programs/signia-registry/target/idl
if-no-files-found: warn
cargo-only:
name: Program Cargo checks (fast)
runs-on: ubuntu-latest
if: ${{ hashFiles('programs/signia-registry/Cargo.toml') != '' }}
defaults:
run:
shell: bash
working-directory: programs/signia-registry
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: |
programs/signia-registry -> target
- name: Format check
run: cargo fmt --all --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: Test (Cargo)
run: cargo test --locked
summary:
name: Summary
runs-on: ubuntu-latest
needs: [anchor-test, cargo-only]
if: always()
steps:
- name: Results
run: |
echo "anchor-test: ${{ needs.anchor-test.result }}"
echo "cargo-only: ${{ needs.cargo-only.result }}"