Browse Source

clippy and fmt run fix, steel workspace check

Ayush 11 months ago
parent
commit
8c74d4123e
2 changed files with 41 additions and 19 deletions
  1. 24 14
      .github/workflows/steel.yml
  2. 17 5
      basics/hello-solana/steel/cargo.toml

+ 24 - 14
.github/workflows/steel.yml

@@ -102,12 +102,19 @@ jobs:
           components: rustfmt
       - uses: mozilla-actions/sccache-action@v0.0.4
       - name: Run fmt
+        env:
+          SCCACHE_GHA_ENABLED: "true"
+          RUSTC_WRAPPER: "sccache"
         run: |
-          readarray -t projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]')
+          echo "Checking projects: ${{ needs.changes.outputs.changed_projects }}"
+          readarray -t projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]' | sed 's/^\.//')
+          echo "Projects to check:"
+          printf '%s\n' "${projects[@]}"
           for project in "${projects[@]}"; do
-            if [ -f "$project/Cargo.toml" ]; then
-              cd "$project"
-              cargo fmt --check
+            if [ -f "${project}/Cargo.toml" ]; then
+              echo "Running fmt check in ${project}"
+              cd "${project}"
+              cargo fmt --check || exit 1
               cd - > /dev/null
             fi
           done
@@ -124,12 +131,19 @@ jobs:
           components: clippy
       - uses: mozilla-actions/sccache-action@v0.0.4
       - name: Run clippy
+        env:
+          SCCACHE_GHA_ENABLED: "true"
+          RUSTC_WRAPPER: "sccache"
         run: |
-          readarray -t projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]')
+          echo "Checking projects: ${{ needs.changes.outputs.changed_projects }}"
+          readarray -t projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]' | sed 's/^\.//')
+          echo "Projects to check:"
+          printf '%s\n' "${projects[@]}"
           for project in "${projects[@]}"; do
-            if [ -f "$project/Cargo.toml" ]; then
-              cd "$project"
-              cargo clippy -- -D warnings
+            if [ -f "${project}/Cargo.toml" ]; then
+              echo "Running clippy in ${project}"
+              cd "${project}"
+              cargo clippy --all-features -- -D warnings || exit 1
               cd - > /dev/null
             fi
           done
@@ -146,12 +160,7 @@ jobs:
     outputs:
       failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
     steps:
-      - uses: actions/checkout@v4
-      - name: Use Node.js
-        uses: actions/setup-node@v4
-        with:
-          node-version: 20.x
-          check-latest: true
+
       - name: Setup build environment
         id: setup
         run: |
@@ -332,3 +341,4 @@ jobs:
           else
             echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
           fi
+          

+ 17 - 5
basics/hello-solana/steel/cargo.toml

@@ -1,8 +1,20 @@
 [workspace]
-members = [
-    "program",
-]
 resolver = "2"
+members = ["program"]
 
-[profile.release]
-overflow-checks = true
+[workspace.package]
+version = "0.1.0"
+edition = "2021"
+license = "Apache-2.0"
+homepage = ""
+documentation = ""
+repository = ""
+readme = "./README.md"
+keywords = ["solana"]
+
+[workspace.dependencies]
+bytemuck = "1.14"
+num_enum = "0.7"
+solana-program = "1.18"
+steel = "2.0"
+thiserror = "1.0"