Skip to content

Commit 8010670

Browse files
authored
fix(ci): clean up CI warnings and deprecations (#91)
1 parent bf8ebc8 commit 8010670

11 files changed

Lines changed: 49 additions & 30 deletions

File tree

.github/actions/bootstrap/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ runs:
3232
echo "run_script=uv run --frozen" | Tee-Object -Append $env:GITHUB_ENV
3333
3434
- name: Setup uv
35-
uses: astral-sh/setup-uv@v4
35+
uses: astral-sh/setup-uv@v7
3636
with:
3737
enable-cache: true
3838
cache-dependency-glob: "**/uv.lock"
3939
python-version: ${{ inputs.python-version }}
4040

4141
- name: Install Task
42-
uses: go-task/setup-task@v1
42+
uses: go-task/setup-task@v2
4343
with:
4444
# Passing a repo token reduces the likelihood of API rate limit exceeded
4545
repo-token: ${{ inputs.token }}
@@ -102,7 +102,7 @@ runs:
102102
echo "PY=$hash" | Tee-Object -Append $env:GITHUB_ENV
103103
104104
- name: Cache pre-commit environments
105-
uses: actions/cache@v4
105+
uses: actions/cache@v5
106106
with:
107107
path: ~/.cache/pre-commit
108108
key: pre-commit|${{ env.PY }}|${{ hashFiles(format('{0}/.pre-commit-config.yaml', inputs.working-directory)) }}

.github/workflows/ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Run SBOM generation
8181
run: task -v sbom
8282
- name: Upload SBOM artifacts
83-
uses: actions/upload-artifact@v5
83+
uses: actions/upload-artifact@v7
8484
with:
8585
name: sbom-files
8686
path: |
@@ -89,15 +89,15 @@ jobs:
8989
- name: Check license compliance
9090
run: task -v license-check
9191
- name: Upload license check results
92-
uses: actions/upload-artifact@v5
92+
uses: actions/upload-artifact@v7
9393
with:
9494
name: license-check-results
9595
path: license-check.json
9696
if-no-files-found: error
9797
- name: Run vulnerability scan
9898
run: task -v vulnscan
9999
- name: Upload vulnerability scan results
100-
uses: actions/upload-artifact@v5
100+
uses: actions/upload-artifact@v7
101101
with:
102102
name: vuln-scan-results
103103
path: vulns.json
@@ -111,11 +111,14 @@ jobs:
111111
# out the repo on Windows. Instead, cookiecutter fetches the template
112112
# directly from the remote branch.
113113
- name: Setup uv
114-
uses: astral-sh/setup-uv@v4
114+
uses: astral-sh/setup-uv@v7
115115
with:
116116
python-version: ${{ env.python_version }}
117+
# No checkout in this job (NTFS-illegal chars in template dir), so disable cache
118+
enable-cache: false
119+
ignore-empty-workdir: true
117120
- name: Install Task
118-
uses: go-task/setup-task@v1
121+
uses: go-task/setup-task@v2
119122
with:
120123
repo-token: ${{ secrets.GITHUB_TOKEN }}
121124
- name: Generate project from template
@@ -138,11 +141,13 @@ jobs:
138141
curl -fsSL "$scriptUrl" -o "$tmpdir/extract_template_zip.py"
139142
repoDir=$(python3 "$tmpdir/extract_template_zip.py" "$tmpdir/template.zip" "$tmpdir/src")
140143
141-
uvx --with gitpython cookiecutter "$repoDir" --no-input --output-dir "$RUNNER_TEMP"
144+
uvx --with gitpython cookiecutter "$repoDir" --no-input \
145+
project_name="ci-test-project" \
146+
--output-dir "$RUNNER_TEMP"
142147
- name: Verify generated project
143148
shell: pwsh
144149
run: |
145-
$project = Join-Path $env:RUNNER_TEMP "replace-me"
150+
$project = Join-Path $env:RUNNER_TEMP "ci-test-project"
146151
147152
# Verify the project directory was created
148153
if (-not (Test-Path $project)) {
@@ -219,25 +224,25 @@ jobs:
219224
- name: Initialize generated project
220225
shell: bash
221226
run: |
222-
cd "$RUNNER_TEMP/replace-me"
227+
cd "$RUNNER_TEMP/ci-test-project"
223228
task -v init
224229
- name: Run unit tests
225230
shell: bash
226231
# Integration tests require Docker (Linux images) which is not
227232
# available on Windows runners; those are covered by the Linux CI job.
228233
run: |
229-
cd "$RUNNER_TEMP/replace-me"
234+
cd "$RUNNER_TEMP/ci-test-project"
230235
task -v unit-test
231236
- name: Build Docker image
232237
shell: bash
233238
run: |
234-
cd "$RUNNER_TEMP/replace-me"
239+
cd "$RUNNER_TEMP/ci-test-project"
235240
task -v build
236241
- name: Verify Docker image
237242
shell: bash
238243
run: |
239-
docker run --rm zenable-io/replace-me:latest --version
240-
docker run --rm zenable-io/replace-me:latest --help
244+
docker run --rm zenable-io/ci-test-project:latest --version
245+
docker run --rm zenable-io/ci-test-project:latest --help
241246
- name: Verify zenable CLI
242247
shell: bash
243248
run: |

Taskfile.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tasks:
4949
# This fixes an "ERROR: Multiple platforms feature is currently not supported for docker driver" pipeline error
5050
# Only create our multiplatform builder if it doesn't already exist; otherwise list information about the one that exists
5151
# It suppresses the inspect output when it's not running in a GitHub Action
52-
- docker buildx inspect multiplatform {{if ne .GITHUB_ACTIONS "true"}}>/dev/null{{end}} || docker buildx create --name multiplatform --driver docker-container --use
52+
- docker buildx inspect multiplatform {{if ne .GITHUB_ACTIONS "true"}}>/dev/null{{end}} 2>/dev/null || docker buildx create --name multiplatform --driver docker-container --use
5353

5454
init:
5555
desc: Initialize the repo for local use; intended to be run after git clone
@@ -152,6 +152,8 @@ tasks:
152152
-w /src \
153153
anchore/syft:latest \
154154
/src \
155+
--source-name={{.PROJECT_SLUG}} \
156+
--source-version={{.VERSION}} \
155157
-o syft-json=sbom.syft.json \
156158
-o spdx-json=sbom.spdx.json \
157159
-o cyclonedx-json=sbom.cyclonedx.json

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[project]
22
name = "ai-native-python"
3+
# Automatically updated by the release task via python-semantic-release (see Taskfile.yml and [tool.semantic_release] below)
34
version = "0.4.1"
45
description = "The AI-Native python paved road generator"
56
authors = [
@@ -50,8 +51,12 @@ ignore = [
5051
plugins = []
5152

5253
[tool.pytest.ini_options]
53-
addopts = "--cov=ai_native_python --cov-append --no-cov-on-fail --cov-fail-under=0 --cov-report=html --cov-report=xml --cov-report=term-missing"
54+
addopts = "--cov=ai_native_python --cov=hooks --cov-append --no-cov-on-fail --cov-fail-under=0 --cov-report=html --cov-report=xml --cov-report=term-missing"
5455
pythonpath = ['.']
56+
filterwarnings = [
57+
# Tests invoke hooks via cookiecutter subprocess, so coverage can't track them directly
58+
"ignore:No data was collected:coverage.exceptions.CoverageWarning",
59+
]
5560
markers = [
5661
"unit: marks tests as unit tests (deselect with '-m \"not unit\"')",
5762
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",

scripts/scan_workflow_logs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ find . -type f -name "*.txt" | while IFS= read -r logfile; do
8282
# Sanitize content to prevent command injection and log poisoning
8383
sanitized_content=$(echo "$content" | tr -d '\n\r' | cut -c1-200)
8484

85+
# Skip JSON data lines (e.g. SBOM/license check output with package names like "deprecated")
86+
if echo "$content" | grep -qE '"(id|name)":\s*"'; then
87+
continue
88+
fi
89+
8590
# Determine the type of issue and output both annotation and count
8691
if echo "$content" | grep -qiE '\berror\b'; then
8792
echo "::error file=$job_name,line=$line_num::$sanitized_content"

{{cookiecutter.project_name|replace(" ", "")}}/.github/actions/bootstrap/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ runs:
2424
echo "run_script=${run_script}" | tee -a "${GITHUB_ENV}"
2525
2626
- name: Setup uv
27-
uses: astral-sh/setup-uv@v4
27+
uses: astral-sh/setup-uv@v7
2828
with:
2929
enable-cache: true
3030
cache-dependency-glob: "**/uv.lock"
3131
python-version: ${{ "{{ inputs.python-version }}" }}
3232

3333
- name: Install Task
34-
uses: go-task/setup-task@v1
34+
uses: go-task/setup-task@v2
3535
with:
3636
# Passing a repo token reduces the likelihood of API rate limit exceeded
3737
repo-token: ${{ "{{ inputs.token }}" }}
@@ -74,7 +74,7 @@ runs:
7474
echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" | tee -a "${GITHUB_ENV}"
7575
7676
- name: Cache pre-commit environments
77-
uses: actions/cache@v4
77+
uses: actions/cache@v5
7878
with:
7979
path: ~/.cache/pre-commit
8080
key: pre-commit|${{ "{{ env.PY }}" }}|${{ "{{ hashFiles(format('{0}/.pre-commit-config.yaml', inputs.working-directory)) }}" }}

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
- name: Set env var for unique artifact uploads
102102
run: echo SANITIZED_PLATFORM="$(echo "${{ "{{ matrix.platform }}" }}" | sed 's/\//_/g')" | tee -a "${GITHUB_ENV}"
103103
- name: Upload SBOM artifacts
104-
uses: actions/upload-artifact@v5
104+
uses: actions/upload-artifact@v7
105105
with:
106106
name: sbom-${{ "{{ env.SANITIZED_PLATFORM }}" }}
107107
path: |
@@ -112,7 +112,7 @@ jobs:
112112
env:
113113
PLATFORM: ${{ "{{ matrix.platform }}" }}
114114
- name: Upload license check results
115-
uses: actions/upload-artifact@v5
115+
uses: actions/upload-artifact@v7
116116
with:
117117
name: license-check-${{ "{{ env.SANITIZED_PLATFORM }}" }}
118118
path: license-check.*.json
@@ -122,7 +122,7 @@ jobs:
122122
env:
123123
PLATFORM: ${{ "{{ matrix.platform }}" }}
124124
- name: Upload vulnerability scan results
125-
uses: actions/upload-artifact@v5
125+
uses: actions/upload-artifact@v7
126126
with:
127127
name: vulns-${{ "{{ env.SANITIZED_PLATFORM }}" }}
128128
path: vulns.*.json

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
- name: Set env var for unique artifact uploads
7777
run: echo SANITIZED_PLATFORM="$(echo "${{ "{{ matrix.platform }}" }}" | sed 's/\//_/g')" | tee -a "${GITHUB_ENV}"
7878
- name: Upload SBOM artifacts
79-
uses: actions/upload-artifact@v5
79+
uses: actions/upload-artifact@v7
8080
with:
8181
name: sbom-${{ "{{ env.SANITIZED_PLATFORM }}" }}
8282
path: |
@@ -87,7 +87,7 @@ jobs:
8787
env:
8888
PLATFORM: ${{ "{{ matrix.platform }}" }}
8989
- name: Upload license check results
90-
uses: actions/upload-artifact@v5
90+
uses: actions/upload-artifact@v7
9191
with:
9292
name: license-check-${{ "{{ env.SANITIZED_PLATFORM }}" }}
9393
path: license-check.*.json
@@ -97,7 +97,7 @@ jobs:
9797
env:
9898
PLATFORM: ${{ "{{ matrix.platform }}" }}
9999
- name: Upload vulnerability scan results
100-
uses: actions/upload-artifact@v5
100+
uses: actions/upload-artifact@v7
101101
with:
102102
name: vulns-${{ "{{ env.SANITIZED_PLATFORM }}" }}
103103
path: vulns.*.json

{{cookiecutter.project_name|replace(" ", "")}}/Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ tasks:
6060
# This fixes an "ERROR: Multiple platforms feature is currently not supported for docker driver" pipeline error
6161
# Only create our multiplatform builder if it doesn't already exist; otherwise list information about the one that exists
6262
# It suppresses the inspect output when it's not running in a GitHub Action
63-
- docker buildx inspect multiplatform {{ '{{if ne .GITHUB_ACTIONS "true"}}' }}>/dev/null{{ '{{end}}' }} || docker buildx create --name multiplatform --driver docker-container --use
63+
- docker buildx inspect multiplatform {{ '{{if ne .GITHUB_ACTIONS "true"}}' }}>/dev/null{{ '{{end}}' }} 2>/dev/null || docker buildx create --name multiplatform --driver docker-container --use
6464

6565
init:
6666
desc: Initialize the repo for local use; intended to be run after git clone

{{cookiecutter.project_name|replace(" ", "")}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pythonpath = ['src']
3535
markers = [
3636
"unit: marks tests as unit tests (deselect with '-m \"not unit\"')",
3737
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
38+
"slow: marks tests as slow tests (deselect with '-m \"not slow\"')",
3839
]
3940

4041
[tool.uv]

0 commit comments

Comments
 (0)