Files
bouncer/.gitea/workflows/ci.yml
user 28f78567df
Some checks failed
CI / secrets (push) Failing after 4s
CI / lint (push) Failing after 6s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
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>
2026-02-22 06:51:50 +01:00

65 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: linux
container:
image: python:3.12-alpine
steps:
- uses: actions/checkout@v4
- name: Install ruff
run: pip install --no-cache-dir -q ruff
- name: Lint
run: ruff check src/ tests/
test:
runs-on: linux
needs: [lint]
container:
image: python:3.12-alpine
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
pip install --no-cache-dir -q -r requirements.txt
pip install --no-cache-dir -q pytest pytest-asyncio
- name: Test
run: PYTHONPATH=src pytest tests/ -v
secrets:
runs-on: linux
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 . -v
build:
runs-on: linux
needs: [test, secrets]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Login to Harbor
run: echo "$HARBOR_PASS" | podman login -u "$HARBOR_USER" --password-stdin harbor.mymx.me
env:
HARBOR_USER: ${{ secrets.HARBOR_USER }}
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
- name: Build and push
run: |
TAG="harbor.mymx.me/library/bouncer:${GITHUB_SHA::8}"
LATEST="harbor.mymx.me/library/bouncer:latest"
podman build -t "$TAG" -t "$LATEST" -f Containerfile .
podman push "$TAG"
podman push "$LATEST"