mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup-cleanup.git
synced 2025-12-31 04:29:08 +00:00
feat: pyproject-based packaging, unified CI and Docker e2e tests
- migrate to pyproject.toml and pip installation - introduce cleanback CLI entrypoint - add unit and Docker-based end-to-end tests - unify GitHub Actions CI and stable tagging - remove legacy tests.yml and pkgmgr requirements https://chatgpt.com/share/69517d20-f850-800f-b6ff-6b983247888f
This commit is contained in:
65
.github/workflows/ci.yml
vendored
Normal file
65
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
tags:
|
||||
- "v*"
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Tests (unit + e2e)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Upgrade pip
|
||||
run: python -m pip install -U pip
|
||||
|
||||
- name: Install project (editable)
|
||||
run: python -m pip install -e .
|
||||
|
||||
- name: Run tests
|
||||
run: make test
|
||||
|
||||
tag-stable:
|
||||
name: Tag stable on version tag
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout (full history for tags)
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git user
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Force-update stable tag to this commit
|
||||
env:
|
||||
SHA: ${{ github.sha }}
|
||||
run: |
|
||||
git tag -f stable "${SHA}"
|
||||
git push -f origin stable
|
||||
41
.github/workflows/tests.yml
vendored
41
.github/workflows/tests.yml
vendored
@@ -1,41 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "**" ]
|
||||
pull_request:
|
||||
branches: [ "**" ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Show Python version
|
||||
run: python -V
|
||||
|
||||
- name: Make main.py executable (optional)
|
||||
run: chmod +x main.py || true
|
||||
|
||||
- name: Install test dependencies (if any)
|
||||
run: |
|
||||
if [ -f requirements.txt ]; then
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: make test
|
||||
Reference in New Issue
Block a user