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 7, 2025
1 parent 30863c0 commit f83d74a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,6 @@ jobs:
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

build-and-test-locally:
needs: [ tag, build-build-tools-image ]
strategy:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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"]}' || format('{{"ref":["{0}"]}}', github.sha)) }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.ref }}

# https://github.com/EmbarkStudios/cargo-deny
- name: Check rust licenses/bans/advisories/sources
if: ${{ !cancelled() }}
run: cargo deny check --hide-inclusion-graph

- name: Post to a Slack channel
if: ${{ github.event_name == 'schedule' && failure() }}
uses: slackapi/slack-github-action@v1
with:
channel-id: ${{ vars.CARGO_DENY_SCHEDULE_FAILURE_CHANNEL }}

Check failure on line 30 in .github/workflows/cargo-deny.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/cargo-deny.yml#L30

undefined configuration variable "cargo_deny_schedule_failure_channel". defined configuration variables in actionlint.yaml are "AZURE_DEV_CLIENT_ID", "AZURE_DEV_REGISTRY_NAME", "AZURE_DEV_SUBSCRIPTION_ID", "AZURE_PROD_CLIENT_ID", "AZURE_PROD_REGISTRY_NAME", "AZURE_PROD_SUBSCRIPTION_ID", "AZURE_TENANT_ID", "BENCHMARK_INGEST_TARGET_PROJECTID", "BENCHMARK_PROJECT_ID_PUB", "BENCHMARK_PROJECT_ID_SUB", "DEV_AWS_OIDC_ROLE_ARN", "DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN", "PGREGRESS_PG16_PROJECT_ID", "PGREGRESS_PG17_PROJECT_ID", "REMOTE_STORAGE_AZURE_CONTAINER", "REMOTE_STORAGE_AZURE_REGION", "SLACK_ON_CALL_QA_STAGING_STREAM", "SLACK_UPCOMING_RELEASE_CHANNEL_ID" [expression]
Raw output
.github/workflows/cargo-deny.yml:30:27: undefined configuration variable "cargo_deny_schedule_failure_channel". defined configuration variables in actionlint.yaml are "AZURE_DEV_CLIENT_ID", "AZURE_DEV_REGISTRY_NAME", "AZURE_DEV_SUBSCRIPTION_ID", "AZURE_PROD_CLIENT_ID", "AZURE_PROD_REGISTRY_NAME", "AZURE_PROD_SUBSCRIPTION_ID", "AZURE_TENANT_ID", "BENCHMARK_INGEST_TARGET_PROJECTID", "BENCHMARK_PROJECT_ID_PUB", "BENCHMARK_PROJECT_ID_SUB", "DEV_AWS_OIDC_ROLE_ARN", "DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN", "PGREGRESS_PG16_PROJECT_ID", "PGREGRESS_PG17_PROJECT_ID", "REMOTE_STORAGE_AZURE_CONTAINER", "REMOTE_STORAGE_AZURE_REGION", "SLACK_ON_CALL_QA_STAGING_STREAM", "SLACK_UPCOMING_RELEASE_CHANNEL_ID" [expression]
slack-message: |
Periodic cargo-deny on ${{ matrix.ref }}: ${{ job.status }}
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>

0 comments on commit f83d74a

Please sign in to comment.