meta(ci): improve CI workflow

This commit is contained in:
Kat Marchán 2019-12-16 19:00:54 -08:00
parent 513d55833d
commit a746fc0216
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 24 additions and 5 deletions

View File

@ -2,12 +2,33 @@ name: Rust
on: [push, pull_request] on: [push, pull_request]
env:
RUSTFLAGS: -Dwarnings
jobs: jobs:
build: fmt_and_docs:
name: Check fmt & build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- name: rustfmt
run: cargo fmt --all -- --check
- name: docs
run: cargo doc
build_and_test:
name: Build & Test
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
rust: [stable, beta, nightly] rust: [1.39.0, stable]
os: [ubuntu-latest, macOS-latest, windows-latest] os: [ubuntu-latest, macOS-latest, windows-latest]
steps: steps:
@ -17,12 +38,10 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
components: rustfmt, clippy components: clippy
override: true override: true
- name: Check - name: Check
run: cargo check run: cargo check
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy - name: Clippy
run: cargo clippy -- -D warnings run: cargo clippy -- -D warnings
- name: Run tests - name: Run tests