[Solana]: Move Solana blockchain to Rust (#3691) #1
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: Linux CI Rust | |
on: | |
push: | |
branches: [ dev, master ] | |
pull_request: | |
branches: [ dev, master ] | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Check formatting, clippy warnings, run tests and check code coverage. | |
build-and-test: | |
permissions: | |
contents: read | |
checks: write | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
tools/install-sys-dependencies-linux | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: "build-and-test" | |
workspaces: | | |
rust | |
- name: Install Rust dependencies | |
run: | | |
tools/install-rust-dependencies dev | |
- name: Check code formatting | |
run: | | |
cargo fmt --check | |
working-directory: rust | |
- name: Check Clippy warnings | |
run: | | |
cargo clippy -- -D warnings | |
working-directory: rust | |
- name: Run tests | |
run: | | |
cargo llvm-cov nextest --profile ci --no-fail-fast --lcov --output-path coverage.info | |
working-directory: rust | |
- name: Rust Test Report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
continue-on-error: true | |
with: | |
name: Rust Tests | |
path: | | |
rust/target/nextest/ci/junit.xml | |
reporter: java-junit | |
- name: Gather and check Rust code coverage | |
run: | | |
tools/check-coverage rust/coverage.stats rust/coverage.info | |
# Run Rust tests in WASM. | |
test-wasm: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
tools/install-sys-dependencies-linux | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: "test-wasm" | |
workspaces: | | |
rust | |
- name: Install Rust dependencies | |
run: | | |
tools/install-rust-dependencies | |
- name: Install emsdk | |
run: tools/install-wasm-dependencies | |
- name: Run tests in WASM | |
run: tools/rust-test wasm |