Skip to content

Commit

Permalink
Move cargo-deny into a separate workflow on a schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgruenhage committed Jan 23, 2025
1 parent 2ab9f69 commit bf20692
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ config-variables:
- SLACK_ON_CALL_QA_STAGING_STREAM
- DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN
- SLACK_ON_CALL_STORAGE_STAGING_STREAM
- SLACK_CARGO_DENY_CHANNEL
5 changes: 0 additions & 5 deletions .github/workflows/_check-codestyle-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,3 @@ jobs:
run: |
cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
cargo hakari manage-deps --dry-run # all workspace crates depend on workspace-hack
# https://github.com/EmbarkStudios/cargo-deny
- name: Check rust licenses/bans/advisories/sources
if: ${{ !cancelled() }}
run: cargo deny check --hide-inclusion-graph
42 changes: 42 additions & 0 deletions .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: cargo deny checks

on:
pull_request:
paths:
- 'Cargo.lock'
schedule:
- cron: '0 0 * * *'

jobs:
cargo-deny:
strategy:
matrix: >-
${{
fromJSON(
github.event_name == 'schedule'
&& '{"ref":["main","release","release-proxy","release-compute"]}'
|| format('{{"ref":["{0}"]}}', github.sha)
)
}}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.ref }}

- name: Check rust licenses/bans/advisories/sources
run: cargo deny check --hide-inclusion-graph

- name: Post to a Slack channel
if: ${{ github.event_name == 'schedule' && failure() }}
uses: slackapi/slack-github-action@v2
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ vars.SLACK_CARGO_DENY_CHANNEL }}
text: |
Periodic cargo-deny on ${{ matrix.ref }}: ${{ job.status }}
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
Pinging @oncall-devprod.

0 comments on commit bf20692

Please sign in to comment.