Skip to content

Commit d53d8d1

Browse files
committed
fix: ci
1 parent a799909 commit d53d8d1

3 files changed

Lines changed: 48 additions & 23 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: 5 additions & 3 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
@@ -78,6 +77,7 @@ jobs:
7877
run: |
7978
sh -c "$(curl -sSfL https://release.solana.com/v2.2.15/install)"
8079
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
80+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
8181
8282
- name: Install Anchor CLI
8383
run: |
@@ -91,15 +91,17 @@ jobs:
9191
9292
- name: Generate Solana keypair
9393
run: |
94+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
9495
solana-keygen new --no-bip39-passphrase
9596
9697
- name: Start Light test validator
9798
run: |
98-
light test-validator &
99-
sleep 30
99+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
100+
light test-validator
100101
101102
- name: Run tests
102103
run: |
104+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
103105
SUB_TESTS='${{ matrix.sub-tests }}'
104106
for test in $(echo $SUB_TESTS | jq -r '.[]'); do
105107
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)