Adding Gitea CI/CD
Some checks failed
CI / install (pull_request) Failing after 1m12s
CI / black (pull_request) Has been skipped
CI / ruff (pull_request) Has been skipped
CI / mypy (pull_request) Has been skipped
CI / pytest (pull_request) Has been skipped

This commit is contained in:
2026-03-26 12:50:01 -07:00
parent 147059108f
commit b746cfc555
3 changed files with 157 additions and 0 deletions

69
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,69 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 9 * * 1" # weekly Monday 9am
jobs:
install:
runs-on: ubuntu-latest
container: python:3.13-slim
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: apt-get update -qq && apt-get install -y -qq libcap-dev
- name: Install Poetry
run: pip install poetry==2.1.1
- name: Install dependencies
run: poetry install --without pi --no-interaction
- name: Cache venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('pyproject.toml') }}
black:
runs-on: ubuntu-latest
container: python:3.13-slim
needs: install
steps:
- uses: actions/checkout@v3
- run: pip install poetry==2.1.1
- run: poetry run black --check src/ tests/
ruff:
runs-on: ubuntu-latest
container: python:3.13-slim
needs: install
steps:
- uses: actions/checkout@v3
- run: pip install poetry==2.1.1
- run: poetry run ruff check src/ tests/
mypy:
runs-on: ubuntu-latest
container: python:3.13-slim
needs: install
steps:
- uses: actions/checkout@v3
- run: pip install poetry==2.1.1
- run: poetry run mypy src/
pytest:
runs-on: ubuntu-latest
container: python:3.13-slim
needs: install
steps:
- uses: actions/checkout@v3
- run: apt-get update -qq && apt-get install -y -qq libcap-dev
- run: pip install poetry==2.1.1
- run: poetry install --without pi --no-interaction
- run: poetry run pytest

View File

@@ -0,0 +1,46 @@
name: Dependency update
on:
push:
branches: [main]
schedule:
- cron: "0 9 * * 1"
jobs:
dependency-update:
runs-on: ubuntu-latest
container: python:3.13-slim
# skip if this is already a dependency update branch
if: "!startsWith(github.ref, 'refs/heads/dependency-updates-')"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.CI_TOKEN }}
- name: Install system dependencies
run: apt-get update -qq && apt-get install -y -qq libcap-dev git curl
- name: Install Poetry
run: pip install poetry==2.1.1
- name: Install dependencies
run: poetry install --without pi --no-interaction
- name: Run dependency update check
id: update
run: |
chmod +x scripts/dependency_update.sh
set +e
bash scripts/dependency_update.sh
echo "changes=$?" >> $GITHUB_OUTPUT
- name: Create pull request
if: steps.update.outputs.changes == '1'
env:
CI_TOKEN: ${{ secrets.CI_TOKEN }}
CI_SERVER_URL: ${{ secrets.CI_SERVER_URL }}
REPO: ${{ github.repository }}
ASSIGNEE_ID: ${{ secrets.CI_ASSIGNEE_ID }}
run: |
chmod +x scripts/create_pr_gitea.sh
bash scripts/create_pr_gitea.sh