permissions:
contents: read
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: test
jobs:
os-check:
runs-on: ${{ matrix.os }}
if: false
name: ${{ matrix.os }} / stable
strategy:
fail-fast: false
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo build
run: cargo build --locked --all-targets
coverage:
runs-on: ${{ vars.RUNNER }}
name: ubuntu / stable / coverage / ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
features:
- "default"
steps:
- uses: actions/checkout@v5
- uses: ubicloud/rust-cache@v2
with:
cache-on-failure: "true"
cache-all-crates: "true"
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov (${{ matrix.features }})
env:
RPC_URL: ${{ secrets.RPC_URL }}
TEST_PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }}
RUST_LOG: info,soly=debug
run: |
if [ "${{ matrix.features }}" == "default" ]; then
cargo llvm-cov --locked --lcov --output-path lcov-${{ matrix.features }}.info -- --nocapture
else
cargo llvm-cov --locked --features "${{ matrix.features }}" --lcov --output-path lcov-${{ matrix.features }}.info -- --nocapture
fi
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov-${{ matrix.features }}.info
flags: ${{ matrix.features }}
env_vars: OS,RUST