jj/.github/workflows/build.yml
Martin von Zweigbergk b4e6fab1af github: restrict Clippy's access again
It seems "checks" is the permissions it needs to be able to comment on
pull-requests.
2022-03-18 22:51:25 -07:00

89 lines
2.5 KiB
YAML

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions: read-all
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Install Rust (stable)
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
profile: minimal
- name: Build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: build
args: --workspace --verbose
- name: Test
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --workspace --verbose
env:
RUST_BACKTRACE: 1
rustfmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: fmt
args: --all -- --check
clippy-stable:
name: Clippy check (stable)
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --workspace
clippy-nightly:
name: Clippy check (nightly)
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --workspace