This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
ci: update matrix build #21
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: tests | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["master"] | |
workflow_dispatch: | |
branches: ["*"] | |
jobs: | |
unit-tests: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: llvm-tools-preview | |
override: true | |
- name: Install cargo-llvm-cov | |
run: | | |
if type cargo-llvm-cov >/dev/null 2>&1; then echo "cargo-llvm-cov is already installed"; else cargo install cargo-llvm-cov ; fi | |
- name: Installing needed dependencies | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Run cargo-llvm-cov | |
run: | | |
cargo llvm-cov --all-features --lib --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} |