Skip to content

setup basic CI checks #3

setup basic CI checks

setup basic CI checks #3

---
name: Unit tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
unit-test-suite:
runs-on: ubuntu-latest
steps:
- name: Install protoc compiler
shell: bash
run: |
sudo apt-get install -y protobuf-compiler
- name: Checkout Source code
uses: actions/checkout@v3
- name: Cache cargo
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: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1
- name: Run fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- --no-deps -D warnings
- name: Run tests
run: cargo test --verbose