| 1 | name: Continuous Integration |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | paths: |
| 6 | - "**.rs" |
| 7 | - "Cargo.toml" |
| 8 | - "Cargo.lock" |
| 9 | workflow_dispatch: |
| 10 | |
| 11 | jobs: |
| 12 | fmt: |
| 13 | name: Source formatting check |
| 14 | runs-on: ubuntu-latest |
| 15 | steps: |
| 16 | - name: Checkout sources |
| 17 | uses: actions/checkout@v2 |
| 18 | |
| 19 | - name: Install Rust toolchain |
| 20 | uses: actions-rs/toolchain@v1 |
| 21 | with: |
| 22 | profile: minimal |
| 23 | toolchain: nightly |
| 24 | override: true |
| 25 | components: rustfmt |
| 26 | |
| 27 | - name: Check formatting |
| 28 | uses: actions-rs/cargo@v1 |
| 29 | with: |
| 30 | command: fmt |
| 31 | args: -- --check |
| 32 | |
| 33 | check: |
| 34 | name: Compilation check |
| 35 | runs-on: ubuntu-latest |
| 36 | strategy: |
| 37 | fail-fast: true |
| 38 | matrix: |
| 39 | rust: |
| 40 | - stable |
| 41 | - beta |
| 42 | - nightly |
| 43 | steps: |
| 44 | - name: Checkout sources |
| 45 | uses: actions/checkout@v2 |
| 46 | |
| 47 | - name: Install Rust toolchain |
| 48 | uses: actions-rs/toolchain@v1 |
| 49 | with: |
| 50 | profile: minimal |
| 51 | toolchain: ${{ matrix.rust }} |
| 52 | override: true |
| 53 | |
| 54 | - name: Run cargo check |
| 55 | uses: actions-rs/cargo@v1 |
| 56 | with: |
| 57 | command: check |
| 58 | |
| 59 | clippy: |
| 60 | name: Lint check |
| 61 | runs-on: ubuntu-latest |
| 62 | strategy: |
| 63 | fail-fast: false |
| 64 | matrix: |
| 65 | rust: |
| 66 | - stable |
| 67 | - beta |
| 68 | - nightly |
| 69 | steps: |
| 70 | - name: Checkout sources |
| 71 | uses: actions/checkout@v2 |
| 72 | |
| 73 | - name: Install Rust toolchain |
| 74 | uses: actions-rs/toolchain@v1 |
| 75 | with: |
| 76 | profile: minimal |
| 77 | toolchain: ${{ matrix.rust }} |
| 78 | override: true |
| 79 | components: clippy |
| 80 | |
| 81 | - name: Run lints |
| 82 | uses: actions-rs/cargo@v1 |
| 83 | with: |
| 84 | command: clippy |
| 85 | args: -- -D warnings |