|
| 1 | +name: Contract Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - 'stellar-lend/contracts/**' |
| 8 | + - 'stellar-lend/packages/test-framework/**' |
| 9 | + - 'stellar-lend/benchmarks/**' |
| 10 | + - '.github/workflows/contract-integration-tests.yml' |
| 11 | + workflow_dispatch: {} |
| 12 | + |
| 13 | +env: |
| 14 | + CARGO_TERM_COLOR: always |
| 15 | + |
| 16 | +jobs: |
| 17 | + integration: |
| 18 | + name: Integration, Fuzz Smoke, Gas Diff |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - uses: dtolnay/rust-toolchain@stable |
| 24 | + with: |
| 25 | + components: rustfmt, clippy |
| 26 | + |
| 27 | + - uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: | |
| 30 | + ~/.cargo/registry |
| 31 | + ~/.cargo/git |
| 32 | + stellar-lend/target |
| 33 | + key: ${{ runner.os }}-contracts-integration-${{ hashFiles('stellar-lend/Cargo.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-contracts-integration- |
| 36 | +
|
| 37 | + - name: Check formatting |
| 38 | + working-directory: stellar-lend |
| 39 | + run: cargo fmt --all -- --check |
| 40 | + |
| 41 | + - name: Run integration framework tests |
| 42 | + working-directory: stellar-lend |
| 43 | + run: cargo test --package test-framework --verbose |
| 44 | + |
| 45 | + - name: Run lending tests |
| 46 | + working-directory: stellar-lend |
| 47 | + run: cargo test --package stellarlend-lending --verbose |
| 48 | + |
| 49 | + - name: Run flash-loan liquidation integration tests |
| 50 | + working-directory: stellar-lend |
| 51 | + run: cargo test --package flash-loan-liquidation-tests --verbose |
| 52 | + |
| 53 | + - name: Run gas benchmarks with regression detection |
| 54 | + working-directory: stellar-lend |
| 55 | + run: cargo run --release --bin run_benchmarks -- --compare benchmarks/baseline.json --output benchmark-results.json |
| 56 | + |
| 57 | + - name: Upload gas diff report |
| 58 | + if: always() |
| 59 | + uses: actions/upload-artifact@v4 |
| 60 | + with: |
| 61 | + name: contract-gas-diff |
| 62 | + path: | |
| 63 | + stellar-lend/benchmark-results.json |
| 64 | + stellar-lend/benchmark-results.md |
0 commit comments