refactor: use native container directive for CI jobs
Replace manual podman run invocations with the runner's container: directive for lint, test, and secrets jobs. Cleaner step definitions, no volume mounts needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+16
-20
@@ -9,44 +9,40 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
|
container:
|
||||||
|
image: python:3.12-alpine
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install ruff
|
||||||
|
run: pip install --no-cache-dir -q ruff
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: ruff check src/ tests/
|
||||||
podman run --rm \
|
|
||||||
-v "$PWD:/app:ro" \
|
|
||||||
-w /app \
|
|
||||||
python:3.12-alpine \
|
|
||||||
sh -c "pip install --no-cache-dir -q ruff && \
|
|
||||||
ruff check src/ tests/"
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
|
container:
|
||||||
|
image: python:3.12-alpine
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Test
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
podman run --rm \
|
pip install --no-cache-dir -q -r requirements.txt
|
||||||
-v "$PWD:/app:ro" \
|
pip install --no-cache-dir -q pytest pytest-asyncio
|
||||||
-w /app \
|
- name: Test
|
||||||
python:3.12-alpine \
|
run: PYTHONPATH=src pytest tests/ -v
|
||||||
sh -c "pip install --no-cache-dir -q -r requirements.txt && \
|
|
||||||
pip install --no-cache-dir -q pytest pytest-asyncio && \
|
|
||||||
PYTHONPATH=src pytest tests/ -v"
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
|
container:
|
||||||
|
image: ghcr.io/gitleaks/gitleaks:latest
|
||||||
|
options: --entrypoint ""
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Scan for secrets
|
- name: Scan for secrets
|
||||||
run: |
|
run: gitleaks detect --source . -v
|
||||||
podman run --rm \
|
|
||||||
-v "$PWD:/scan:ro" \
|
|
||||||
ghcr.io/gitleaks/gitleaks:latest \
|
|
||||||
detect --source /scan -v
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
|
|||||||
Reference in New Issue
Block a user