Merge pull request #550 from jotel-dev/feat/waveform-architecture-adr #130
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Soroban Contracts CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - "contracts/**" | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - "contracts/**" | |
| jobs: | |
| contracts: | |
| name: Contracts CI | |
| runs-on: ubuntu-latest | |
| env: | |
| CARGO_TARGET_DIR: ${{ github.workspace }}/contracts/target | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.88.0 | |
| target: wasm32-unknown-unknown | |
| components: clippy, rustfmt | |
| - name: Cache Cargo | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/ | |
| ~/.cargo/git/ | |
| contracts/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('contracts/**/Cargo.lock') }} | |
| - name: Run Tests (all contracts) | |
| working-directory: contracts | |
| run: | | |
| set -euo pipefail | |
| skip_pattern='^\./lottery$' | |
| while IFS= read -r manifest; do | |
| dir=$(dirname "$manifest") | |
| if [[ "$dir" =~ $skip_pattern ]]; then | |
| echo "Skipping legacy contract $dir" | |
| continue | |
| fi | |
| echo "Testing $dir" | |
| (cd "$dir" && cargo test --verbose) | |
| done < <(find . -mindepth 2 -name Cargo.toml -not -path '*/target/*' | sort) | |
| - name: Build All Contracts | |
| working-directory: contracts | |
| run: | | |
| set -euo pipefail | |
| skip_pattern='^\./lottery$' | |
| while IFS= read -r manifest; do | |
| dir=$(dirname "$manifest") | |
| if [[ "$dir" =~ $skip_pattern ]]; then | |
| echo "Skipping legacy contract $dir" | |
| continue | |
| fi | |
| echo "Building $dir" | |
| (cd "$dir" && cargo build --target wasm32-unknown-unknown --release) | |
| done < <(find . -mindepth 2 -name Cargo.toml -not -path '*/target/*' | sort) | |
| - name: Lint All Contracts | |
| working-directory: contracts | |
| run: | | |
| set -euo pipefail | |
| skip_pattern='^\./lottery$' | |
| while IFS= read -r manifest; do | |
| dir=$(dirname "$manifest") | |
| if [[ "$dir" =~ $skip_pattern ]]; then | |
| echo "Skipping legacy contract $dir" | |
| continue | |
| fi | |
| echo "Linting $dir" | |
| (cd "$dir" && cargo clippy -- -D warnings) | |
| (cd "$dir" && cargo fmt -- --check) | |
| done < <(find . -mindepth 2 -name Cargo.toml -not -path '*/target/*' | sort) |