Use Github Actions for PR tests (#71)

This commit is contained in:
Yong Wen Chua 2019-11-13 10:59:51 +08:00 committed by GitHub
parent 3a9b1fd7e8
commit 0630b4c34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 1 deletions

69
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,69 @@
on:
push:
branches:
- master
pull_request: {}
name: Continuous integration
jobs:
ci:
strategy:
matrix:
rust:
- nightly
- nightly-2019-05-21 # MSRV
os:
- ubuntu-latest
- windows-latest
- macOS-latest
cargo_flags:
- "--all-features"
- "--no-default-features"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
name: Checkout
- uses: actions-rs/toolchain@v1
name: Verify Rust Toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Remove Rust Toolchain file
run: rm rust-toolchain
- uses: actions-rs/cargo@v1
name: Clippy Lint
with:
command: clippy
args: ${{ matrix.cargo_flags }} --all-targets -- -D warnings
- uses: actions-rs/cargo@v1
name: Build
with:
command: build
args: ${{ matrix.cargo_flags }} --verbose
- uses: actions-rs/cargo@v1
name: Unit Tests
with:
command: test
args: ${{ matrix.cargo_flags }}
- uses: actions-rs/cargo@v1
name: Format Check
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: Build Documentation
with:
command: doc
args: ${{ matrix.cargo_flags }} --no-deps

View File

@ -2,11 +2,12 @@ sudo: false
language: rust
rust:
- nightly
- nightly-2019-05-21 # Minimum supported
branches:
only:
- master
cache: cargo
env:
global:
- TRAVIS_CARGO_NIGHTLY_FEATURE=""