feat: run CI jobs in podman containers, add requirements-dev.txt
Some checks failed
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>
This commit is contained in:
@@ -7,60 +7,60 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
gitleaks:
|
gitleaks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux:host
|
||||||
|
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: Install gitleaks
|
|
||||||
run: |
|
|
||||||
VERSION=$(curl -sI https://github.com/gitleaks/gitleaks/releases/latest | grep -i '^location:' | grep -oP 'v[\d.]+')
|
|
||||||
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/${VERSION}/gitleaks_${VERSION#v}_linux_x64.tar.gz" \
|
|
||||||
| tar xz -C /usr/local/bin gitleaks
|
|
||||||
- name: Scan for secrets
|
- name: Scan for secrets
|
||||||
run: gitleaks detect --source . --verbose
|
run: gitleaks detect --source . --verbose
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux:host
|
||||||
|
container:
|
||||||
|
image: python:3.13-alpine
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- name: Install deps
|
||||||
with:
|
run: pip install -q -r requirements-dev.txt
|
||||||
python-version: "3.13"
|
- name: Lint
|
||||||
- run: pip install -e . && pip install ruff
|
run: ruff check src/ tests/ plugins/
|
||||||
- run: ruff check src/ tests/ plugins/
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux:host
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.11", "3.12", "3.13"]
|
python-version: ["3.11", "3.12", "3.13"]
|
||||||
|
container:
|
||||||
|
image: python:${{ matrix.python-version }}-alpine
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- name: Install system deps
|
||||||
with:
|
run: apk add --no-cache opus-dev
|
||||||
python-version: ${{ matrix.python-version }}
|
- name: Install Python deps
|
||||||
- run: sudo apt-get update && sudo apt-get install -y libopus0
|
run: pip install -q -r requirements-dev.txt
|
||||||
- run: pip install -e . && pip install pymumble pytest
|
- name: Test
|
||||||
- run: pytest -v
|
run: pytest -v
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux:host
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
needs: [gitleaks, test]
|
needs: [gitleaks, test]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Login to Harbor
|
- name: Login to Harbor
|
||||||
run: >-
|
run: >-
|
||||||
echo "${{ secrets.HARBOR_PASS }}" |
|
podman login harbor.mymx.me
|
||||||
docker login harbor.mymx.me
|
|
||||||
-u "${{ secrets.HARBOR_USER }}"
|
-u "${{ secrets.HARBOR_USER }}"
|
||||||
--password-stdin
|
-p "${{ secrets.HARBOR_PASS }}"
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
TAG="harbor.mymx.me/library/derp:${GITHUB_SHA::8}"
|
TAG="harbor.mymx.me/library/derp:${GITHUB_SHA::8}"
|
||||||
LATEST="harbor.mymx.me/library/derp:latest"
|
LATEST="harbor.mymx.me/library/derp:latest"
|
||||||
docker build -t "$TAG" -t "$LATEST" .
|
podman build -t "$TAG" -t "$LATEST" .
|
||||||
docker push "$TAG"
|
podman push "$TAG"
|
||||||
docker push "$LATEST"
|
podman push "$LATEST"
|
||||||
|
|||||||
4
requirements-dev.txt
Normal file
4
requirements-dev.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-e .
|
||||||
|
pymumble>=1.6
|
||||||
|
pytest>=7.0
|
||||||
|
ruff>=0.4
|
||||||
Reference in New Issue
Block a user