Skip to content

[MTG-237] fix ci

[MTG-237] fix ci #5

Workflow file for this run

name: Lint and Test
on:
push:
branches: master
pull_request:
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.14.10"
RUST_LINT_TOOLCHAIN: nightly
RUST_TEST_TOOLCHAIN: "1.66.1"
defaults:
run:
working-directory: ./
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_LINT_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Run fmt
run: cargo fmt -- --check
# The style and complexity lints have not been processed yet.
- name: Run clippy
run: cargo clippy -- --deny=warnings --allow=clippy::style --allow=clippy::complexity
tests:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config build-essential libudev-dev
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_TEST_TOOLCHAIN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
# Install Solana
- name: Cache Solana binaries
uses: actions/cache@v2
with:
path: ~/.cache/solana
key: ${{ runner.os }}-${{ env.SOLANA_VERSION }}
- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
echo "Generating keypair..."
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent
- name: Run bpf tests
run: cargo test-sbf