| 1 |
name: Rust CI |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: [ master ] |
| 5 |
pull_request: |
| 6 |
branches: [ master ] |
| 7 |
jobs: |
| 8 |
build: |
| 9 |
runs-on: ubuntu-latest |
| 10 |
strategy: |
| 11 |
matrix: |
| 12 |
rust: ["1.34.2", stable, beta, nightly] |
| 13 |
command: [build, test] |
| 14 |
steps: |
| 15 |
- uses: actions/checkout@v2 |
| 16 |
- run: rustup default ${{ matrix.rust }} |
| 17 |
- name: build |
| 18 |
run: > |
| 19 |
cargo build --verbose |
| 20 |
- name: test |
| 21 |
if: ${{ matrix.rust != '1.34.2' }} |
| 22 |
run: > |
| 23 |
cargo test --tests --benches |
| 24 |
|
| 25 |
rustfmt: |
| 26 |
runs-on: ubuntu-latest |
| 27 |
steps: |
| 28 |
- uses: actions/checkout@v2 |
| 29 |
- uses: actions-rs/toolchain@v1 |
| 30 |
with: |
| 31 |
toolchain: stable |
| 32 |
override: true |
| 33 |
components: rustfmt |
| 34 |
- name: Run rustfmt check |
| 35 |
uses: actions-rs/cargo@v1 |
| 36 |
with: |
| 37 |
command: fmt |
| 38 |
args: -- --check |