Skip to content

Setup Github Actions (#2) #14

Setup Github Actions (#2)

Setup Github Actions (#2) #14

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-
- name: Format
uses: actions-rust-lang/rustfmt@v1
- name: Lint
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
env:
RUSTFLAGS: "-D warnings"
- name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov, nextest
- name: Test
run: cargo llvm-cov nextest --no-fail-fast --lcov --output-path lcov.info
- name: Upload Coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}