| name: Lint |
| on: |
| pull_request: |
| branches: [master, main] |
| push: |
| branches: [staging, trying] |
| concurrency: |
| group: lint-${{ github.ref }} |
| cancel-in-progress: true |
| jobs: |
| lint: |
| name: Lint |
| needs: [clippy] |
| runs-on: ubuntu-latest |
| steps: |
| - name: Done |
| run: exit 0 |
| clippy: |
| name: Clippy |
| strategy: |
| fail-fast: false |
| matrix: |
| os: [ubuntu-latest] |
| rust: [stable] |
| runs-on: ${{ matrix.os }} |
| steps: |
| - name: Install rust |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: ${{ matrix.rust }} |
| override: true |
| components: clippy |
| - name: Cache Builds |
| uses: Swatinem/rust-cache@v1 |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - name: Clippy no features |
| uses: actions-rs/cargo@v1 |
| with: |
| command: clippy |
| args: --no-default-features -- -D warnings |
| - name: Clippy with all features |
| uses: actions-rs/cargo@v1 |
| with: |
| command: clippy |
| args: --all-features --all-targets --all -- -D warnings |
| format: |
| name: Formatting |
| runs-on: ubuntu-latest |
| steps: |
| - name: Install rust |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: nightly |
| override: true |
| components: rustfmt |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - name: Format check |
| uses: actions-rs/cargo@v1 |
| with: |
| command: fmt |
| args: -- --check |