Skip to content

Commit 0feb976

Browse files
chore(gha): separate scheduled audit in separate workflow
1 parent fb49909 commit 0feb976

File tree

3 files changed

+84
-11
lines changed

3 files changed

+84
-11
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Scheduled Audit"
2+
3+
on:
4+
workflow_call:
5+
# No inputs needed at this time
6+
7+
jobs:
8+
audit-scheduled:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
21+
with:
22+
version: "0.6.3"
23+
enable-cache: true
24+
cache-dependency-glob: uv.lock
25+
26+
- name: Install dev tools
27+
shell: bash
28+
run: .github/workflows/_install_dev_tools.bash
29+
30+
- name: Install Python, venv and dependencies
31+
shell: bash
32+
run: uv sync --all-extras --frozen --link-mode=copy
33+
34+
- name: Create .env file
35+
uses: SpicyPizza/create-envfile@ace6d4f5d7802b600276c23ca417e669f1a06f6f # v2.0.3
36+
with:
37+
envkey_AIGNOSTICS_LOGFIRE_TOKEN: "${{ secrets.AIGNOSTICS_LOGFIRE_TOKEN }}"
38+
envkey_AIGNOSTICS_SENTRY_DSN: "${{ secrets.AIGNOSTICS_SENTRY_DSN }}"
39+
envkey_AIGNOSTICS_API_ROOT: https://platform.aignostics.com
40+
envkey_AIGNOSTICS_CLIENT_ID_DEVICE: ${{ secrets.AIGNOSTICS_CLIENT_ID_DEVICE }}
41+
envkey_AIGNOSTICS_CLIENT_ID_INTERACTIVE: ${{ secrets.AIGNOSTICS_CLIENT_ID_INTERACTIVE }}
42+
envkey_AIGNOSTICS_REFRESH_TOKEN: ${{ secrets.AIGNOSTICS_REFRESH_TOKEN }}
43+
envkey_AIGNOSTICS_BUCKET_NAME: ${{ secrets.AIGNOSTICS_BUCKET_NAME }}
44+
envkey_AIGNOSTICS_BUCKET_HMAC_ACCESS_KEY_ID: ${{ secrets.AIGNOSTICS_BUCKET_HMAC_ACCESS_KEY_ID }}
45+
envkey_AIGNOSTICS_BUCKET_HMAC_SECRET_ACCESS_KEY: ${{ secrets.AIGNOSTICS_BUCKET_HMAC_SECRET_ACCESS_KEY }}
46+
fail_on_empty: false
47+
48+
- name: Set up GCP credentials for bucket access
49+
shell: bash
50+
run: |
51+
echo "${{ secrets.GCP_CREDENTIALS }}" | base64 -d > credentials.json
52+
echo "GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/credentials.json" >> $GITHUB_ENV
53+
54+
- name: Audit
55+
shell: bash
56+
run: make audit
57+
58+
- name: Upload test results
59+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
60+
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
61+
with:
62+
name: test-results-scheduled
63+
path: |
64+
reports/mypy_junit.xml
65+
reports/sbom.json
66+
reports/sbom.spdx
67+
reports/licenses.csv
68+
reports/licenses.json
69+
reports/licenses_grouped.json
70+
reports/vulnerabilities.json
71+
retention-days: 7

.github/workflows/_scheduled-test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ jobs:
5151
echo "${{ secrets.GCP_CREDENTIALS }}" | base64 -d > credentials.json
5252
echo "GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/credentials.json" >> $GITHUB_ENV
5353
54-
- name: Audit
55-
shell: bash
56-
run: make audit
57-
5854
- name: Test / scheduled
5955
env:
6056
BETTERSTACK_HEARTBEAT_URL: "${{ secrets.BETTERSTACK_HEARTBEAT_URL }}"
@@ -100,13 +96,6 @@ jobs:
10096
with:
10197
name: test-results-scheduled
10298
path: |
103-
reports/mypy_junit.xml
104-
reports/sbom.json
105-
reports/sbom.spdx
106-
reports/licenses.csv
107-
reports/licenses.json
108-
reports/licenses_grouped.json
109-
reports/vulnerabilities.json
11099
reports/junit.xml
111100
reports/coverage.xml
112101
reports/coverage.md

.github/workflows/audit-scheduled.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Scheduled Audit"
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *'
6+
7+
jobs:
8+
audit-scheduled:
9+
uses: ./.github/workflows/_scheduled-audit.yml
10+
permissions:
11+
contents: read
12+
id-token: write
13+
secrets: inherit

0 commit comments

Comments
 (0)