Skip to content

Commit

Permalink
GitHub Actions: clippy interaction fix for Win/Mac (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
iceiix authored Mar 7, 2022
1 parent 2fd1044 commit 45f9cd4
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,22 @@ jobs:
- name: Build binary
run: |
cargo build --verbose --release
- name: Run clippy
- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/action-has-permission@1.0.6
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1.0.7
if: steps.check_permissions.outputs.has-permission
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all-targets -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check
- name: Upload binary
Expand Down Expand Up @@ -103,11 +114,22 @@ jobs:
chmod a+x target/release/stevenarella
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
- name: Run clippy
- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/action-has-permission@1.0.6
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1.0.7
if: steps.check_permissions.outputs.has-permission
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all-targets -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check
- name: Package binary
Expand Down

0 comments on commit 45f9cd4

Please sign in to comment.