better CI

This commit is contained in:
adria0.eth 2021-12-10 15:04:27 +01:00 committed by GitHub
parent 5baca51f1d
commit 2e0eec6830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 15 deletions

View File

@ -1,22 +1,41 @@
name: Rust
name: Check on every push
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
on: [push, pull_request]
jobs:
build:
build_ubuntu:
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
components: rustfmt, clippy
- name: Formatter
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --all-features
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose
# This is used to ensure that Cargo.lock is up to date
- name: Check for unstaged files
run: git diff --exit-code