Skip to content

Commit a8aae47

Browse files
committed
fix: ci
1 parent a799909 commit a8aae47

3 files changed

Lines changed: 52 additions & 25 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,5 @@ jobs:
3939
${{ runner.os }}-cargo-lint-
4040
${{ runner.os }}-cargo-
4141
42-
- name: Check formatting
43-
run: cargo fmt --all --check
44-
45-
- name: Run clippy
46-
run: cargo clippy --all-targets --all-features -- -D warnings
47-
48-
- name: Run clippy (create-and-update)
49-
run: cargo clippy --manifest-path create-and-update/Cargo.toml --all-targets --all-features -- -D warnings
50-
51-
- name: Run clippy (counter/anchor)
52-
run: cargo clippy --manifest-path counter/anchor/Cargo.toml --all-targets --all-features -- -D warnings
53-
54-
- name: Run clippy (counter/native)
55-
run: cargo clippy --manifest-path counter/native/Cargo.toml --all-targets --all-features -- -D warnings
56-
57-
- name: Run clippy (counter/pinocchio)
58-
run: cargo clippy --manifest-path counter/pinocchio/Cargo.toml --all-targets --all-features -- -D warnings
59-
60-
- name: Run clippy (account-comparison)
61-
run: cargo clippy --manifest-path account-comparison/Cargo.toml --all-targets --all-features -- -D warnings
42+
- name: Run lint script
43+
run: ./scripts/lint.sh

.github/workflows/program-tests.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
uses: actions/setup-node@v4
5555
with:
5656
node-version: "23.5.0"
57-
cache: "npm"
5857

5958
- name: Cache Rust dependencies
6059
uses: actions/cache@v4
@@ -76,8 +75,13 @@ jobs:
7675
7776
- name: Install Solana CLI
7877
run: |
79-
sh -c "$(curl -sSfL https://release.solana.com/v2.2.15/install)"
80-
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
78+
# Install via cargo for better CI reliability
79+
cargo install solana-cli --version 2.2.15
80+
# Verify installation
81+
~/.cargo/bin/solana --version
82+
~/.cargo/bin/solana-keygen --version
83+
# Add to PATH for subsequent steps
84+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
8185
8286
- name: Install Anchor CLI
8387
run: |
@@ -95,11 +99,11 @@ jobs:
9599
96100
- name: Start Light test validator
97101
run: |
98-
light test-validator &
99-
sleep 30
102+
light test-validator
100103
101104
- name: Run tests
102105
run: |
106+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
103107
SUB_TESTS='${{ matrix.sub-tests }}'
104108
for test in $(echo $SUB_TESTS | jq -r '.[]'); do
105109
echo "Running: $test"

scripts/lint.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo "Checking formatting..."
6+
7+
# Check formatting for each crate
8+
echo "Checking create-and-update..."
9+
cd create-and-update && cargo fmt --check && cd ..
10+
11+
echo "Checking counter/anchor..."
12+
cd counter/anchor && cargo fmt --check && cd ../..
13+
14+
echo "Checking counter/native..."
15+
cd counter/native && cargo fmt --check && cd ../..
16+
17+
echo "Checking counter/pinocchio..."
18+
cd counter/pinocchio && cargo fmt --check && cd ../..
19+
20+
echo "Checking account-comparison..."
21+
cd account-comparison && cargo fmt --check && cd ..
22+
23+
echo "Running clippy..."
24+
25+
# Run clippy for each crate
26+
echo "Running clippy on create-and-update..."
27+
cargo clippy --manifest-path create-and-update/Cargo.toml --all-targets --all-features -- -D warnings
28+
29+
echo "Running clippy on counter/anchor..."
30+
cargo clippy --manifest-path counter/anchor/Cargo.toml --all-targets --all-features -- -D warnings
31+
32+
echo "Running clippy on counter/native..."
33+
cargo clippy --manifest-path counter/native/Cargo.toml --all-targets --all-features -- -D warnings
34+
35+
echo "Running clippy on counter/pinocchio..."
36+
cargo clippy --manifest-path counter/pinocchio/Cargo.toml --all-targets --all-features -- -D warnings
37+
38+
echo "Running clippy on account-comparison..."
39+
cargo clippy --manifest-path account-comparison/Cargo.toml --all-targets --all-features -- -D warnings
40+
41+
echo "Lint checks completed successfully!"

0 commit comments

Comments
 (0)