Add github actions for checking code

This commit is contained in:
Maxim Shishmarev 2021-03-23 11:46:50 +11:00
parent fbc7c22f3d
commit 8009fefee1
1 changed files with 29 additions and 0 deletions

29
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Build and check
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo check --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Check formatting
run: cargo fmt -- --check