Run all program-test in SBF mode and speed up CI #57
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: Build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: lint | |
runs-on: big-runner-1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt, clippy | |
toolchain: nightly | |
- name: Install cargo-sort from crates.io | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-sort | |
- name: Install cargo-udeps from crates.io | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-udeps | |
- run: cargo sort --workspace --check | |
- run: cargo fmt --all --check | |
- run: cargo clippy --all-features --all-targets --tests -- -D warnings | |
- run: cargo udeps --all-features --all-targets --tests | |
test: | |
name: test | |
runs-on: big-runner-1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install anchor-cli from crates.io | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: anchor-cli | |
version: "0.29.0" | |
- name: install solana toolsuite | |
run: sh -c "$(curl -sSfL https://release.solana.com/v1.16.20/install)" | |
- name: add to path | |
run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
- run: anchor build --idl idl --program-name validator_history | |
- name: Check for diff on IDL | |
run: git diff --exit-code | |
- name: cargo test | |
run: cargo test --all-targets --all-features --color auto | |
shell: bash | |
env: | |
RUST_LOG: trace | |
SBF_OUT_DIR: ./target/deploy | |
verified-build: | |
name: Build Verifiable Artifact | |
runs-on: big-runner-1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install solana-verify from crates.io | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: solana-verify | |
- run: solana-verify build --library-name validator_history | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: | | |
target/deploy/validator_history.so | |
programs/validator-history/idl/validator_history.json | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
target/deploy/validator_history.so | |
programs/validator-history/idl/validator_history.json |