Skip to content

Commit 7a1547e

Browse files
committed
setup rust, steel clippy fmt
1 parent 21869d3 commit 7a1547e

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/steel.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
matrix: ${{ steps.matrix.outputs.matrix }}
2828
steps:
2929
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
with:
32+
components: rustfmt, clippy
3033
- uses: dorny/paths-filter@v3
3134
id: changes
3235
if: github.event_name == 'pull_request'
@@ -37,6 +40,23 @@ jobs:
3740
- added|modified: '**/steel/**'
3841
workflow:
3942
- added|modified: '.github/workflows/steel.yml'
43+
44+
- name: Run fmt and clippy
45+
run: |
46+
readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
47+
for project in "${all_projects[@]}"; do
48+
echo "::group::Checking ${project}"
49+
if [ ! -f "${project}/Cargo.toml" ]; then
50+
echo "::error::No Cargo.toml found in ${project}"
51+
exit 1
52+
fi
53+
cd "${project}"
54+
cargo fmt --check
55+
cargo clippy --all-features -- -D warnings
56+
cd - > /dev/null
57+
echo "::endgroup::"
58+
done
59+
4060
- name: Analyze Changes
4161
id: analyze
4262
run: |
@@ -146,9 +166,6 @@ jobs:
146166
run: |
147167
npm install --global pnpm
148168
149-
# Install Steel CLI
150-
cargo install --quiet steel-cli
151-
152169
# Create the build and test function
153170
cat << 'EOF' > build_and_test.sh
154171
function build_and_test() {
@@ -237,7 +254,7 @@ jobs:
237254
chmod +x build_and_test.sh
238255
239256
- name: Setup Solana Stable
240-
uses: heyAyushh/setup-solana@v2
257+
uses: heyAyushh/setup-solana@v2.01
241258
with:
242259
solana-cli-version: stable
243260
- name: Build and Test with Stable
@@ -246,9 +263,10 @@ jobs:
246263
solana -V
247264
rustc -V
248265
solana-keygen new --no-bip39-passphrase --force
266+
cargo install --quiet steel-cli
249267
process_projects "stable"
250268
- name: Setup Solana Beta
251-
uses: heyAyushh/setup-solana@v2
269+
uses: heyAyushh/setup-solana@v2.01
252270
with:
253271
solana-cli-version: beta
254272
- name: Build and Test with Beta
@@ -257,6 +275,7 @@ jobs:
257275
solana -V
258276
rustc -V
259277
solana-keygen new --no-bip39-passphrase --force
278+
cargo install --quiet steel-cli
260279
process_projects "beta"
261280
262281
- name: Set failed projects output

0 commit comments

Comments
 (0)