| 1 | name: pipeline |
| 2 | on: [push, pull_request] |
| 3 | |
| 4 | jobs: |
| 5 | clippy: |
| 6 | name: Clippy |
| 7 | runs-on: ubuntu-latest |
| 8 | steps: |
| 9 | - uses: actions/checkout@v2 |
| 10 | - uses: actions-rs/toolchain@v1 |
| 11 | with: |
| 12 | profile: minimal |
| 13 | toolchain: stable |
| 14 | override: true |
| 15 | components: clippy, rustfmt |
| 16 | - run: cargo fmt --version |
| 17 | - uses: actions-rs/cargo@v1 |
| 18 | name: Format |
| 19 | with: |
| 20 | command: fmt |
| 21 | args: --all -- --check |
| 22 | - run: cargo clippy --version |
| 23 | - uses: actions-rs/cargo@v1 |
| 24 | name: Clippy |
| 25 | with: |
| 26 | command: clippy |
| 27 | args: -- -D warnings |
| 28 | |
| 29 | build: |
| 30 | name: Build and test |
| 31 | runs-on: ubuntu-latest |
| 32 | steps: |
| 33 | - uses: actions/checkout@v2 |
| 34 | - uses: actions-rs/toolchain@v1 |
| 35 | with: |
| 36 | profile: minimal |
| 37 | toolchain: stable |
| 38 | override: true |
| 39 | - uses: actions-rs/cargo@v1 |
| 40 | name: Test (and build debug) |
| 41 | with: |
| 42 | command: test |
| 43 | - uses: actions-rs/cargo@v1 |
| 44 | name: Build release |
| 45 | with: |
| 46 | command: build |
| 47 | args: --release |
| 48 | - name: Publish to crates.io |
| 49 | if: ${{ startsWith(github.ref, 'refs/tags') }} |
| 50 | uses: actions-rs/cargo@v1 |
| 51 | with: |
| 52 | command: publish |
| 53 | args: --token ${{ secrets.CRATES_IO_TOKEN }} |