chainerror/.github/workflows/rust.yml

73 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2020-03-03 15:01:02 +01:00
name: Rust
2020-08-28 16:45:24 +02:00
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- created
2020-03-03 15:01:02 +01:00
jobs:
build:
2020-08-28 16:45:24 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
version:
- 1.54.0
2020-08-28 16:45:24 +02:00
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v1
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
2020-08-28 16:45:24 +02:00
with:
toolchain: ${{ matrix.version }}
profile: minimal
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Build --all-features
run: cargo build --verbose --all-features
- name: Run tests --all-features
run: cargo test --verbose --all-features
2020-03-03 15:01:02 +01:00
2020-08-28 16:45:24 +02:00
fmt:
name: cargo fmt
2020-03-03 15:01:02 +01:00
runs-on: ubuntu-latest
2020-08-28 16:45:24 +02:00
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
2020-08-28 16:45:24 +02:00
with:
components: rustfmt
toolchain: stable
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
2020-03-03 15:01:02 +01:00
2020-08-28 16:45:24 +02:00
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
2020-08-28 16:45:24 +02:00
with:
components: clippy
toolchain: stable
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings