|
| 1 | +# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md |
| 2 | +# |
| 3 | +# While our "example" application has the platform-specific code, |
| 4 | +# for simplicity we are compiling and testing everything on the Ubuntu environment only. |
| 5 | +# For multi-OS testing see the `cross.yml` workflow. |
| 6 | + |
| 7 | +on: [push, pull_request] |
| 8 | + |
| 9 | +name: Build |
| 10 | + |
| 11 | +jobs: |
| 12 | + check: |
| 13 | + name: Check |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Checkout sources |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Install stable toolchain |
| 20 | + uses: actions-rs/toolchain@v1 |
| 21 | + with: |
| 22 | + profile: minimal |
| 23 | + toolchain: stable |
| 24 | + override: true |
| 25 | + |
| 26 | + - name: Run cargo check |
| 27 | + uses: actions-rs/cargo@v1 |
| 28 | + with: |
| 29 | + command: check |
| 30 | + |
| 31 | + test: |
| 32 | + name: Test Suite |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout sources |
| 36 | + uses: actions/checkout@v2 |
| 37 | + |
| 38 | + - name: Install stable toolchain |
| 39 | + uses: actions-rs/toolchain@v1 |
| 40 | + with: |
| 41 | + profile: minimal |
| 42 | + toolchain: stable |
| 43 | + override: true |
| 44 | + |
| 45 | + - name: Run cargo test |
| 46 | + uses: actions-rs/cargo@v1 |
| 47 | + with: |
| 48 | + command: test |
| 49 | + |
| 50 | + unstable: |
| 51 | + name: Test Suite (unstable) |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout sources |
| 55 | + uses: actions/checkout@v2 |
| 56 | + |
| 57 | + - name: Install nightly toolchain |
| 58 | + uses: actions-rs/toolchain@v1 |
| 59 | + with: |
| 60 | + profile: minimal |
| 61 | + toolchain: nightly |
| 62 | + override: true |
| 63 | + |
| 64 | + - name: Run cargo test --features unstable |
| 65 | + uses: actions-rs/cargo@v1 |
| 66 | + with: |
| 67 | + command: test |
| 68 | + args: --features unstable |
| 69 | + |
| 70 | + |
| 71 | + lints: |
| 72 | + name: Lints |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + - name: Checkout sources |
| 76 | + uses: actions/checkout@v2 |
| 77 | + |
| 78 | + - name: Install stable toolchain |
| 79 | + uses: actions-rs/toolchain@v1 |
| 80 | + with: |
| 81 | + profile: minimal |
| 82 | + toolchain: stable |
| 83 | + override: true |
| 84 | + components: rustfmt, clippy |
| 85 | + |
| 86 | + - name: Run cargo fmt |
| 87 | + uses: actions-rs/cargo@v1 |
| 88 | + with: |
| 89 | + command: fmt |
| 90 | + args: --all -- --check |
| 91 | + |
| 92 | + - name: Run cargo clippy |
| 93 | + uses: actions-rs/cargo@v1 |
| 94 | + with: |
| 95 | + command: clippy |
0 commit comments