|
| 1 | +name: Solana Integration Checks |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - solana/integration |
| 6 | + pull_request: null |
| 7 | + |
| 8 | +env: |
| 9 | + RUSTC_VERSION: 1.76.0 |
| 10 | +jobs: |
| 11 | + cancel-previous-runs: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Cancel Previous Runs |
| 15 | + uses: styfle/cancel-workflow-action@0.9.1 |
| 16 | + with: |
| 17 | + access_token: ${{ github.token }} |
| 18 | + cargo-clippy-and-lint: |
| 19 | + name: Clippy Checks |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - name: Install toolchain |
| 24 | + uses: dtolnay/rust-toolchain@master |
| 25 | + with: |
| 26 | + toolchain: ${{ env.RUSTC_VERSION }} |
| 27 | + components: clippy, rustfmt |
| 28 | + - name: cargo fmt --check |
| 29 | + run: cargo fmt --check |
| 30 | + working-directory: ./solana |
| 31 | + - name: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings |
| 32 | + run: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings |
| 33 | + working-directory: ./solana |
| 34 | + - name: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings |
| 35 | + run: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings |
| 36 | + working-directory: ./solana |
| 37 | + test: |
| 38 | + name: Run Tests |
| 39 | + runs-on: ubuntu-latest |
| 40 | + # Anchor Docker image: https://www.anchor-lang.com/docs/verifiable-builds#images |
| 41 | + container: backpackapp/build:v0.29.0 |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - name: Install NPM dependencies |
| 45 | + run: npm ci |
| 46 | + working-directory: ./solana |
| 47 | + - name: cargo test --features localnet --no-default-features |
| 48 | + run: cargo test --features localnet --no-default-features |
| 49 | + working-directory: ./solana |
| 50 | + - name: cargo test --features testnet --no-default-features |
| 51 | + run: cargo test --features testnet --no-default-features |
| 52 | + working-directory: ./solana |
| 53 | + - name: anchor build --arch sbf -- --features testnet |
| 54 | + run: anchor build --arch sbf -- --features testnet |
| 55 | + working-directory: ./solana |
| 56 | + - name: Create artifact directory |
| 57 | + run: mkdir -p ts/tests/artifacts |
| 58 | + working-directory: ./solana |
| 59 | + - name: Copy Testnet Matching Engine Object |
| 60 | + run: cp target/deploy/matching_engine.so ts/tests/artifacts/testnet_matching_engine.so |
| 61 | + working-directory: ./solana |
| 62 | + - name: Copy Testnet Token Router Object |
| 63 | + run: cp target/deploy/token_router.so ts/tests/artifacts/testnet_token_router.so |
| 64 | + working-directory: ./solana |
| 65 | + - name: Copy Upgrade Manager Object |
| 66 | + run: cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so |
| 67 | + working-directory: ./solana |
| 68 | + - name: anchor build --arch sbf -- --features integration-test |
| 69 | + run: anchor build --arch sbf -- --features integration-test |
| 70 | + working-directory: ./solana |
| 71 | + - name: anchor test --skip-build |
| 72 | + run: anchor test --skip-build |
| 73 | + working-directory: ./solana |
0 commit comments