Refactor and bugfixing - a way to view it #52
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: Lint and Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
SOLANA_VERSION: "1.18.9" | |
RUST_TOOLCHAIN: "1.78.0" | |
defaults: | |
run: | |
working-directory: ./ | |
jobs: | |
lint: | |
name: Linter | |
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_TOOLCHAIN }} | |
components: rustfmt, clippy | |
cache: true | |
- name: Run fmt | |
run: cargo fmt -- --check | |
- name: Run clippy | |
run: cargo clippy --all-targets --all-features --workspace --exclude rewards -- -D warnings | |
tests: | |
name: Tests | |
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 nightly | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
cache: true | |
- name: Cache Solana binaries | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/solana | |
key: ${{ runner.os }}-${{ env.RUST_TOOLCHAIN }} | |
- 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/.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: Switch toolchain | |
run: | | |
rustup override set ${{ env.RUST_TOOLCHAIN }} | |
solana-install init ${{ env.SOLANA_VERSION }} | |
- name: Run tests | |
run: cargo test-bpf |