Skip to content

New crate and CI

New crate and CI #1

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- 'v*.*.*'
pull_request:
types: [ opened, synchronize, reopened ]
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
tests:
name: Run tests with coverage
runs-on:
labels: ubuntu-latest-m
env:
CARGO_TERM_COLOR: always
LLVMCOV_VERSION: 0.5.14
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
components: clippy, rustfmt
- name: Cache rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: rust-cache-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.SQLX_VERSION }}-${{ env.LLVMCOV_VERSION }}
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --version=${{ env.LLVMCOV_VERSION }} --locked
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Check With Clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
env:
APP_RPC__URI: http://127.0.0.1:8545
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false