Some checks failed
- Use container: directive for gitleaks, lint, and test jobs - Build job stays on host (needs podman for image build/push) - Add requirements-dev.txt for unified dev/test dependency install Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
gitleaks:
|
|
runs-on: linux:host
|
|
container:
|
|
image: ghcr.io/gitleaks/gitleaks:latest
|
|
options: --entrypoint ""
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Scan for secrets
|
|
run: gitleaks detect --source . --verbose
|
|
|
|
lint:
|
|
runs-on: linux:host
|
|
container:
|
|
image: python:3.13-alpine
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install deps
|
|
run: pip install -q -r requirements-dev.txt
|
|
- name: Lint
|
|
run: ruff check src/ tests/ plugins/
|
|
|
|
test:
|
|
runs-on: linux:host
|
|
needs: [lint]
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.11", "3.12", "3.13"]
|
|
container:
|
|
image: python:${{ matrix.python-version }}-alpine
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install system deps
|
|
run: apk add --no-cache opus-dev
|
|
- name: Install Python deps
|
|
run: pip install -q -r requirements-dev.txt
|
|
- name: Test
|
|
run: pytest -v
|
|
|
|
build:
|
|
runs-on: linux:host
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
needs: [gitleaks, test]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Login to Harbor
|
|
run: >-
|
|
podman login harbor.mymx.me
|
|
-u "${{ secrets.HARBOR_USER }}"
|
|
-p "${{ secrets.HARBOR_PASS }}"
|
|
- name: Build and push
|
|
run: |
|
|
TAG="harbor.mymx.me/library/derp:${GITHUB_SHA::8}"
|
|
LATEST="harbor.mymx.me/library/derp:latest"
|
|
podman build -t "$TAG" -t "$LATEST" .
|
|
podman push "$TAG"
|
|
podman push "$LATEST"
|