better CI
This commit is contained in:
parent
5baca51f1d
commit
2e0eec6830
|
@ -1,22 +1,41 @@
|
||||||
name: Rust
|
name: Check on every push
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_ubuntu:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v1
|
||||||
- name: Build
|
|
||||||
run: cargo build --verbose
|
- uses: actions-rs/toolchain@v1
|
||||||
- name: Run tests
|
with:
|
||||||
run: cargo test --verbose
|
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
|
||||||
|
|
Loading…
Reference in New Issue