Merge pull request #4 from lsunsi/master #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: push | |
jobs: | |
codestyle: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
components: rustfmt | |
rust-version: stable | |
- uses: actions/checkout@v2 | |
- run: cargo fmt --all -- --check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
components: clippy | |
- uses: actions/checkout@v2 | |
- run: cargo clippy --all-targets --all-features -- -D clippy::all | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
- uses: actions/checkout@v2 | |
- run: cargo check --all | |
test: | |
needs: [codestyle, lint, compile] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
rust: [stable, 1.56.1] | |
exclude: | |
- os: macOS-latest | |
rust: 1.56.1 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: ${{ matrix.rust }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Test | |
run: cargo test |