solana-ibc: add Anchor tests to CI #108
This file contains 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: PR Checks | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- master | |
env: | |
SOLANA_VERSION: v1.16.3 | |
jobs: | |
misc: | |
name: Miscellaneous checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: clippy rustfmt | |
- name: Check formatting | |
run: cargo fmt --all --check | |
- name: Install cargo-deny | |
run: cargo install cargo-deny | |
- name: Check bans | |
run: cargo-deny --all-features check bans | |
- name: Check Clippy (all features) | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features -- -D warnings | |
stable: | |
name: Rust tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: Run tests (default features) | |
run: cargo test | |
- name: Run tests (no default features) | |
run: cargo test --no-default-features | |
- name: Run tests (all features) | |
run: cargo test --all-features | |
nightly: | |
name: Rust Miri tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: miri | |
- name: Run tests with Miri | |
run: cargo miri test -- --skip ::stress_test | |
anchor: | |
name: Anchor tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install Solana Platform tools | |
# solana platform tools are required to build the programs using bpf | |
run: curl -sSfL https://release.solana.com/$SOLANA_VERSION/install | sh | |
- name: Copy Keypair to Solana Config | |
run: cp solana/solana-ibc/keypair.json ~/.config/solana/id.json | |
- name: Install Anchor | |
# We need to build from master because 0.28 doesn’t support workspace | |
# inheritance in Cargo.toml. | |
run: cargo install --git https://github.com/coral-xyz/anchor anchor-cli | |
- name: Run tests | |
run: anchor test | |