Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clippy): allow unprivileged runs of clippy #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 29 additions & 12 deletions .github/workflows/lints-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,39 @@ name: Beta lints
on: push

jobs:
clippy-beta:
name: Clippy (beta)
clippy:
name: Clippy
timeout-minutes: 30
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v2
with:
components: clippy
override: false
- name: Run Clippy (beta)
uses: actions-rs/clippy-check@v1
continue-on-error: true
persist-credentials: false

- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/[email protected]
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run clippy action to produce annotations
uses: actions-rs/[email protected]
if: ${{ steps.check_permissions.outputs.has-permission }}
with:
name: Clippy (beta)
# GitHub displays the clippy job and its results as separate entries
name: Clippy (stable) Results
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -W clippy::all
args: --all-features --all-targets -- -D warnings

- uses: actions-rs/[email protected]
if: ${{ !steps.check_permissions.outputs.has-permission }}
with:
toolchain: stable
override: true

- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all-features --all-targets -- -D warnings
35 changes: 27 additions & 8 deletions .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,38 @@ on: pull_request

jobs:
clippy:
name: Clippy (1.56.1)
name: Clippy
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v2
with:
components: clippy
override: false
- name: Run clippy
uses: actions-rs/clippy-check@v1
persist-credentials: false

- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/[email protected]
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run clippy action to produce annotations
uses: actions-rs/[email protected]
if: ${{ steps.check_permissions.outputs.has-permission }}
with:
name: Clippy (1.56.1)
# GitHub displays the clippy job and its results as separate entries
name: Clippy (stable) Results
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings

- uses: actions-rs/[email protected]
if: ${{ !steps.check_permissions.outputs.has-permission }}
with:
toolchain: stable
override: true

- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all-features --all-targets -- -D warnings