| 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: [stable, beta, nightly] |
| 13 |
features: ["", "alloc", "std", "async"] |
| 14 |
steps: |
| 15 |
- uses: actions/checkout@v2 |
| 16 |
- run: rustup default ${{ matrix.rust }} |
| 17 |
- name: build |
| 18 |
run: > |
| 19 |
cargo build --verbose --no-default-features --features "$FEATURES" |
| 20 |
env: |
| 21 |
FEATURES: ${{ matrix.features }} |
| 22 |
- name: test |
| 23 |
run: > |
| 24 |
cargo test --tests --benches --no-default-features --features "$FEATURES" --release |
| 25 |
if: ${{ matrix.rust != '1.34.2' }} |
| 26 |
env: |
| 27 |
FEATURES: ${{ matrix.features }} |
| 28 |
build_msrv: |
| 29 |
runs-on: ubuntu-latest |
| 30 |
strategy: |
| 31 |
matrix: |
| 32 |
features: ["", "std"] |
| 33 |
steps: |
| 34 |
- uses: actions/checkout@v2 |
| 35 |
- run: rustup default "1.34.2" |
| 36 |
- name: build |
| 37 |
run: cargo build --verbose --no-default-features --features "$FEATURES" |
| 38 |
env: |
| 39 |
FEATURES: ${{ matrix.features }} |
| 40 |
rustfmt: |
| 41 |
runs-on: ubuntu-latest |
| 42 |
steps: |
| 43 |
- uses: actions/checkout@v2 |
| 44 |
- uses: actions-rs/toolchain@v1 |
| 45 |
with: |
| 46 |
toolchain: stable |
| 47 |
override: true |
| 48 |
components: rustfmt, clippy |
| 49 |
- name: Run rustfmt check |
| 50 |
uses: actions-rs/cargo@v1 |
| 51 |
with: |
| 52 |
command: fmt |
| 53 |
args: -- --check |