diff --git a/.github/workflows/rust-ci-tests.yml b/.github/workflows/rust-ci-tests.yml new file mode 100644 index 0000000..e783082 --- /dev/null +++ b/.github/workflows/rust-ci-tests.yml @@ -0,0 +1,60 @@ +rname: Rust CI Tests + +on: + pull_request: + paths: + - "contracts/**" + - "Cargo.toml" + - "Cargo.lock" + - "rust-toolchain.toml" + push: + branches: + - main + - master + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Rust Compilation Check + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + components: rustfmt, clippy + + - name: Cache cargo registry + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-test- + ${{ runner.os }}-cargo- + + - name: Check compilation (abundance-token) + run: cargo check --package abundance-token + working-directory: contracts + + - name: Check compilation (crowdfund) + run: cargo check --package soroban-crowdfund-contract + working-directory: contracts + + - name: Check compilation (mock-token) + run: cargo check --package mock-token + working-directory: contracts + + - name: Check all workspace packages compile + run: cargo check --workspace + working-directory: contracts diff --git a/Cargo.toml b/Cargo.toml index 4341406..c76df77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,4 @@ lto = true [workspace.dependencies] soroban-sdk = "20.0.0-rc2" soroban-token-sdk = "20.0.0-rc2" +