Skip to content

Commit

Permalink
add cargo audit to daily CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser999 committed Apr 3, 2024
1 parent c665243 commit 367a64e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/reusable-run-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
run_tests:
description: If tests need to be run, will be 'true'
value: ${{ github.event_name != 'pull_request' || jobs.changes.outputs.test_workflow == 'true' || jobs.changes.outputs.crates == 'true' }}
run_audit:
description: If cargo audit needs to be run, will be 'true'
value: ${{ github.event_name != 'pull_request' || jobs.changes.outputs.test_workflow == 'true' || jobs.changes.outputs.lockfile == 'true' }}
run_docker:
description: If docker workflow needs to be run, will be 'true'
value: ${{ github.event_name != 'pull_request' || jobs.changes.outputs.docker_workflow == 'true' || contains(github.event.pull_request.labels.*.name, 'docker-build') }}
Expand Down Expand Up @@ -52,6 +55,7 @@ jobs:
markdown: ${{ steps.filters.outputs.markdown }}
rustfmt: ${{ steps.filters.outputs.rustfmt }}
charts: ${{ steps.filters.outputs.charts }}
lockfile: ${{ steps.filters.outputs.lockfile }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
Expand Down Expand Up @@ -89,3 +93,5 @@ jobs:
- 'rustfmt.toml'
charts:
- 'charts/**'
lockfile:
- 'Cargo.lock'
12 changes: 12 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Scheduled
on:
schedule:
- cron: '0 0 * * *'
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ jobs:
run: cargo fetch --locked

audit:
runs-on: buildjet-2vcpu-ubuntu-2204
runs-on: ubuntu-22.04
needs: run_checker
if: needs.run_checker.outputs.run_tests == 'true'
if: needs.run_checker.outputs.run_audit == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.76.0
Expand Down

0 comments on commit 367a64e

Please sign in to comment.