Add solana implementation #15
Workflow file for this run
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: Solana CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
solana-sbf: | |
name: Solana Cargo SBF | |
runs-on: ubuntu-latest | |
container: backpackapp/build:v0.29.0 | |
env: | |
RUSTFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get rust toolchain version | |
id: toolchain | |
run: | | |
RUST_VERSION="$(awk '/channel =/ { print substr($3, 2, length($3)-2) }' solana/rust-toolchain)" | |
echo "::set-output name=version::${RUST_VERSION}" | |
- name: Cache rust toolchain | |
uses: actions/cache@v3 | |
env: | |
cache-name: solana-toolchain | |
with: | |
path: | | |
~/.cargo/bin | |
~/.rustup | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.toolchain.outputs.version }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@55c7845fad90d0ae8b2e83715cb900e5e861e8cb | |
with: | |
toolchain: ${{ steps.toolchain.outputs.version }} | |
components: "clippy,rustfmt" | |
- name: Run `cargo fmt` | |
run: cargo fmt --check --all | |
working-directory: ./solana | |
- name: Run `cargo check` | |
run: cargo check --workspace --tests | |
working-directory: ./solana | |
- name: Run `cargo clippy` | |
run: cargo clippy --workspace --tests | |
working-directory: ./solana | |
- name: make build | |
run: make build | |
working-directory: ./solana | |
- name: cargo test-sbf | |
env: | |
RUST_BACKTRACE: "1" | |
run: cargo test-sbf | |
working-directory: ./solana | |
- name: make anchor-test | |
run: make anchor-test | |
working-directory: ./solana |