Skip to content

feat: add ci #2

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,5 @@ jobs:
${{ runner.os }}-cargo-lint-
${{ runner.os }}-cargo-

- name: Check formatting
run: cargo fmt --all --check

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run clippy (create-and-update)
run: cargo clippy --manifest-path create-and-update/Cargo.toml --all-targets --all-features -- -D warnings

- name: Run clippy (counter/anchor)
run: cargo clippy --manifest-path counter/anchor/Cargo.toml --all-targets --all-features -- -D warnings

- name: Run clippy (counter/native)
run: cargo clippy --manifest-path counter/native/Cargo.toml --all-targets --all-features -- -D warnings

- name: Run clippy (counter/pinocchio)
run: cargo clippy --manifest-path counter/pinocchio/Cargo.toml --all-targets --all-features -- -D warnings

- name: Run clippy (account-comparison)
run: cargo clippy --manifest-path account-comparison/Cargo.toml --all-targets --all-features -- -D warnings
- name: Run lint script
run: ./scripts/lint.sh
48 changes: 25 additions & 23 deletions .github/workflows/program-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,25 @@ jobs:
strategy:
matrix:
include:
- program: all-examples
- program: create-and-update
sub-tests: '[
"cargo test-sbf -p create-and-update"
]'
- program: counter-anchor
sub-tests: '[
"cargo test-sbf -p create-and-update",
"cargo test-sbf -p counter --manifest-path counter/anchor/Cargo.toml",
"cd counter/anchor && npm install && npm test",
"cargo test-sbf -p counter --manifest-path counter/native/Cargo.toml",
"cargo test-sbf -p counter --manifest-path counter/pinocchio/Cargo.toml",
"cd counter/anchor && npm install && npm test"
]'
- program: counter-native
sub-tests: '[
"cargo test-sbf -p counter --manifest-path counter/native/Cargo.toml"
]'
- program: counter-pinocchio
sub-tests: '[
"cargo test-sbf -p counter --manifest-path counter/pinocchio/Cargo.toml"
]'
- program: account-comparison
sub-tests: '[
"cargo test-sbf -p account-comparison --manifest-path account-comparison/Cargo.toml"
]'

Expand All @@ -42,7 +54,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "23.5.0"
cache: "npm"

- name: Cache Rust dependencies
uses: actions/cache@v4
Expand All @@ -57,34 +68,25 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev pkg-config

- name: Install Solana CLI
run: |
sh -c "$(curl -sSfL https://release.solana.com/v2.2.15/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

- name: Install Anchor CLI
run: |
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
avm install latest
avm use latest
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana-keygen new --no-bip39-passphrase

- name: Install Light CLI
run: |
npm install -g @lightprotocol/zk-compression-cli

- name: Generate Solana keypair
- name: Install Photon Indexer
run: |
solana-keygen new --no-bip39-passphrase
cargo install --git https://github.com/lightprotocol/photon.git --rev 129fe6518021ad3c2e90fc7de1e1abc7dcb32250 --locked

- name: Start Light test validator
run: |
light test-validator &
sleep 30
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
light test-validator

- name: Run tests
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Required versions:
- **Rust**: 1.86.0 or later
- **Solana CLI**: 2.2.15
- **Anchor CLI**: 0.31.1
- **Zk compression CLI**: 0.27.0
- **Node.js**: 23.5.0 or later

Install the Light CLI:
Expand Down
4 changes: 2 additions & 2 deletions account-comparison/programs/account-comparison/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ light-sdk = { git = "https://github.com/lightprotocol/light-protocol.git", rev =
] }

[dev-dependencies]
light-client = { git = "https://github.com/lightprotocol/light-protocol.git", rev = "d298b45a9c8bd94148c172a7d67ae2136fa6c6b1" }
light-client = "0.13.0"
litesvm = "0.6.1"
solana-keypair = "2.2"
solana-message = "2.2"
solana-pubkey = { version = "2.2", features = ["curve25519", "sha2"] }
solana-signer = "2.2"
solana-transaction = "2.2"
light-program-test = { git = "https://github.com/lightprotocol/light-protocol.git", rev = "d298b45a9c8bd94148c172a7d67ae2136fa6c6b1" }
light-program-test = "0.13.1"
tokio = "1.43.0"
solana-sdk = "2.2"

Expand Down
Loading
Loading