Parcourir la source

fixes returns

Ayush il y a 11 mois
Parent
commit
e395585d9d
2 fichiers modifiés avec 15 ajouts et 11 suppressions
  1. 12 9
      .github/workflows/steel.yml
  2. 3 2
      basics/hello-solana/steel/Cargo.toml

+ 12 - 9
.github/workflows/steel.yml

@@ -112,14 +112,16 @@ jobs:
         run: |
           readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
           for project in "${all_projects[@]}"; do
-            if [ -f "${project}/Cargo.toml" ]; then
-              echo "::group::Checking ${project}"
-              cd "${project}"
-              cargo fmt --check
-              cargo clippy --all-features -- -D warnings
-              cd - > /dev/null
-              echo "::endgroup::"
+            echo "::group::Checking ${project}"
+            if [ ! -f "${project}/Cargo.toml" ]; then
+              echo "::error::No Cargo.toml found in ${project}"
+              exit 1
             fi
+            cd "${project}"
+            cargo fmt --check
+            cargo clippy --all-features -- -D warnings
+            cd - > /dev/null
+            echo "::endgroup::"
           done
 
   build-and-test:
@@ -157,6 +159,7 @@ jobs:
         id: setup
         run: |
           npm install --global pnpm
+
           # Create the build and test function
           cat << 'EOF' > build_and_test.sh
           function build_and_test() {
@@ -197,7 +200,7 @@ jobs:
                 cd - > /dev/null
                 return 1
               fi
-              
+
               # Build
               if ! steel build; then
                 echo "::error::steel build failed for $project"
@@ -214,7 +217,7 @@ jobs:
                 return 1
               fi
             fi
-            
+
             echo "Build and tests succeeded for $project with $solana_version version."
             cd - > /dev/null
             return 0

+ 3 - 2
basics/hello-solana/steel/cargo.toml → basics/hello-solana/steel/Cargo.toml

@@ -1,6 +1,6 @@
 [workspace]
 resolver = "2"
-members = ["program"]
+members = ["api", "program"]
 
 [workspace.package]
 version = "0.1.0"
@@ -13,9 +13,10 @@ readme = "./README.md"
 keywords = ["solana"]
 
 [workspace.dependencies]
+hello-solana-api = { path = "./api", version = "0.1.0" }
 bytemuck = "1.14"
 num_enum = "0.7"
 solana-program = "1.18"
 steel = "2.0"
 thiserror = "1.0"
-solana-sdk = "1.18"
+solana-sdk = "1.18"