Skip to content

Commit ffd03b5

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
Add cargo fmt and cargo clippy to CI workflows
Co-Authored-By: Jayant Krishnamurthy <[email protected]>
1 parent dfd19e1 commit ffd03b5

File tree

7 files changed

+56
-0
lines changed

7 files changed

+56
-0
lines changed

.github/workflows/ci-cosmwasm-contract.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ jobs:
2626
toolchain: 1.82.0
2727
components: rustfmt, clippy
2828
override: true
29+
- name: Format check
30+
run: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all -- --check
31+
if: success() || failure()
32+
- name: Clippy check
33+
run: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
34+
if: success() || failure()
2935
- name: Build
3036
run: cargo build --verbose
37+
if: success() || failure()
3138
- name: Run tests
3239
run: cargo test --verbose
40+
if: success() || failure()

.github/workflows/ci-fortuna.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,12 @@ jobs:
1919
profile: minimal
2020
toolchain: 1.82.0
2121
override: true
22+
- name: Format check
23+
run: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --check
24+
if: success() || failure()
25+
- name: Clippy check
26+
run: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
27+
if: success() || failure()
2228
- name: Run executor tests
2329
run: cargo test --manifest-path ./apps/fortuna/Cargo.toml
30+
if: success() || failure()

.github/workflows/ci-fuel-contract.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ jobs:
3030
run: forc build --verbose
3131
- name: Run tests with Forc
3232
run: forc test --verbose
33+
if: success() || failure()
3334
- name: Rust add wasm32-unknown-unknown target
3435
run: rustup target add wasm32-unknown-unknown
36+
if: success() || failure()
37+
- name: Format check
38+
run: cargo fmt --manifest-path ./target_chains/fuel/contracts/Cargo.toml --all -- --check
39+
if: success() || failure()
40+
- name: Clippy check
41+
run: cargo clippy --manifest-path ./target_chains/fuel/contracts/Cargo.toml --tests -- --deny warnings
42+
if: success() || failure()
3543
- name: Build
3644
run: cargo build --verbose
45+
if: success() || failure()
3746
- name: Run tests
3847
run: cargo test --verbose
48+
if: success() || failure()

.github/workflows/ci-hermes-server.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ jobs:
2424
uses: arduino/setup-protoc@v3
2525
with:
2626
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Format check
28+
run: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all -- --check
29+
if: success() || failure()
30+
- name: Clippy check
31+
run: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
32+
if: success() || failure()
2733
- name: Run executor tests
2834
run: cargo test --manifest-path ./apps/hermes/server/Cargo.toml
35+
if: success() || failure()

.github/workflows/ci-lazer-rust.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ jobs:
3636
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
3737
- name: check Cargo.toml formatting
3838
run: find . -name Cargo.toml -exec taplo fmt --check --diff {} \;
39+
- name: Format check
40+
run: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all -- --check
41+
if: success() || failure()
42+
- name: Clippy check
43+
run: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
44+
if: success() || failure()
3945
- name: Build Solana programs
4046
run: cargo build-sbf
47+
if: success() || failure()
4148
- name: test
4249
run: cargo test
50+
if: success() || failure()

.github/workflows/ci-remote-executor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,12 @@ jobs:
2525
run: |
2626
sh -c "$(curl -sSfL https://release.solana.com/v1.18.23/install)"
2727
echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
28+
- name: Format check
29+
run: cargo +1.73.0 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all -- --check
30+
if: success() || failure()
31+
- name: Clippy check
32+
run: cargo +1.73.0 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
33+
if: success() || failure()
2834
- name: Run executor tests
2935
run: cargo test-sbf --manifest-path ./governance/remote_executor/Cargo.toml
36+
if: success() || failure()

.github/workflows/ci-solana-contract.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,18 @@ jobs:
3232
run: |
3333
sh -c "$(curl -sSfL https://release.solana.com/v1.16.20/install)"
3434
echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
35+
- name: Format check
36+
run: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all -- --check
37+
if: success() || failure()
38+
- name: Clippy check
39+
run: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
40+
if: success() || failure()
3541
- name: Build
3642
run: cargo-build-sbf
43+
if: success() || failure()
3744
- name: Run tests
3845
run: cargo-test-sbf
46+
if: success() || failure()
3947
- name: Run sdk tests
4048
run: cargo test --package pyth-solana-receiver-sdk
49+
if: success() || failure()

0 commit comments

Comments
 (0)