add lint and test actions

This commit is contained in:
Kaan Barmore-Genç 2022-08-22 22:12:57 -04:00
parent 1f48fc9ebb
commit f47b3f09e7
Signed by: kaan
GPG key ID: B2E280771CD62FCF
2 changed files with 42 additions and 0 deletions

17
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,17 @@
on: push
name: lint checks
jobs:
rust_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
rust_format_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cargo fmt --all --check

25
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: test
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
jobs:
test:
name: run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install stable --component llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true