From ea5ec680c544ca9bf42e98a3964a3b2bd0810bc5 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Thu, 23 Jul 2026 13:05:25 +0200 Subject: [PATCH] Migrate CI from GitLab to Gitea Actions Replace .gitlab-ci.yml with .gitea/workflows/ci.yml, keeping the same lint/format/typecheck/pip-audit/pytest jobs against python:3.11-slim, and update docs that referenced the old GitLab pipeline file. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 61 ------------------------------- CLAUDE.md | 4 +-- deploy/systemd/README.md | 4 +-- 4 files changed, 81 insertions(+), 65 deletions(-) create mode 100644 .gitea/workflows/ci.yml delete mode 100644 .gitlab-ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..1388288 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI + +on: + push: + pull_request: + +jobs: + lint: + name: lint:ruff + runs-on: ubuntu-latest + container: python:3.11-slim + steps: + - uses: actions/checkout@v4 + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: pip-${{ hashFiles('pyproject.toml') }} + - run: pip install -e ".[dev,plotting]" + - run: ruff check gallery plotstyle tests + + format: + name: format:ruff + runs-on: ubuntu-latest + container: python:3.11-slim + steps: + - uses: actions/checkout@v4 + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: pip-${{ hashFiles('pyproject.toml') }} + - run: pip install -e ".[dev,plotting]" + - run: ruff format --check gallery plotstyle tests + + typecheck: + name: typecheck:ty + runs-on: ubuntu-latest + container: python:3.11-slim + steps: + - uses: actions/checkout@v4 + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: pip-${{ hashFiles('pyproject.toml') }} + - run: pip install -e ".[dev,plotting]" + - run: ty check gallery plotstyle + + vulnerabilities: + name: vulnerabilities:pip-audit + runs-on: ubuntu-latest + container: python:3.11-slim + steps: + - uses: actions/checkout@v4 + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: pip-${{ hashFiles('pyproject.toml') }} + - run: pip install -e ".[dev,plotting]" + - run: pip-audit + + test: + name: test:pytest + runs-on: ubuntu-latest + container: python:3.11-slim + needs: [lint, format, typecheck, vulnerabilities] + steps: + - uses: actions/checkout@v4 + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: pip-${{ hashFiles('pyproject.toml') }} + - run: pip install -e ".[dev,plotting]" + - run: python -m pytest tests/ -v diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 6da6b9f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -# GitLab CI/CD Pipeline for ETPlot -# Lints, type-checks, and tests the package. No container build/publish. - -stages: - - check - - test - -image: python:3.11-slim - -variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - -cache: - key: "$CI_COMMIT_REF_SLUG" - paths: - - .cache/pip - -.install: &install - before_script: - - pip install -e ".[dev,plotting]" - -# --------------------------------------------------------------------------- -# Check: lint, format, type check, vulnerabilities -# --------------------------------------------------------------------------- - -lint:ruff: - stage: check - <<: *install - script: - - ruff check gallery plotstyle tests - -format:ruff: - stage: check - <<: *install - script: - - ruff format --check gallery plotstyle tests - -typecheck:ty: - stage: check - <<: *install - script: - - ty check gallery plotstyle - -vulnerabilities:pip-audit: - stage: check - <<: *install - script: - - pip-audit - -# --------------------------------------------------------------------------- -# Test -# --------------------------------------------------------------------------- - -test:pytest: - stage: test - <<: *install - script: - - python -m pytest tests/ -v - artifacts: - when: always - expire_in: 30 days diff --git a/CLAUDE.md b/CLAUDE.md index e163131..10b8756 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -55,7 +55,7 @@ ty check gallery plotstyle pip-audit ``` -**Before committing**, run the same checks CI (`.gitlab-ci.yml`) runs and make sure they pass — `ruff check`, `ruff format --check`, `ty check`, `pip-audit`, and `pytest tests/`. Catching a failure locally is faster than waiting on the pipeline. +**Before committing**, run the same checks CI (`.gitea/workflows/ci.yml`) runs and make sure they pass — `ruff check`, `ruff format --check`, `ty check`, `pip-audit`, and `pytest tests/`. Catching a failure locally is faster than waiting on the pipeline. ## Architecture @@ -133,6 +133,6 @@ The frontend is vanilla ES modules — no build step. `assets/js/main.js` import ### Deployment -The project ships a `Dockerfile` plus `docker-compose.yml` (a `generator` service that runs `gallery generate` on an interval, and an `nginx`-based `web` service serving the output — see `deploy/entrypoint.sh` and `deploy/nginx.conf`). This suits a dedicated VM/server you fully control. CI (`.gitlab-ci.yml`) runs `ruff check`, `ruff format --check`, `ty check`, `pip-audit`, and pytest directly against a `python:3.11-slim` image — no container build/publish in CI. For local development the `.venv` (or `uv`) is sufficient. +The project ships a `Dockerfile` plus `docker-compose.yml` (a `generator` service that runs `gallery generate` on an interval, and an `nginx`-based `web` service serving the output — see `deploy/entrypoint.sh` and `deploy/nginx.conf`). This suits a dedicated VM/server you fully control. CI (`.gitea/workflows/ci.yml`, run via Gitea Actions) runs `ruff check`, `ruff format --check`, `ty check`, `pip-audit`, and pytest directly against a `python:3.11-slim` image — no container build/publish in CI. For local development the `.venv` (or `uv`) is sufficient. On shared HPC login nodes without a Docker daemon (e.g. KIT ETP, where `public_html` is already auto-served) use a plain venv install plus a `systemd --user` timer instead — see `deploy/systemd/README.md`. diff --git a/deploy/systemd/README.md b/deploy/systemd/README.md index 048ec1c..e46ab88 100644 --- a/deploy/systemd/README.md +++ b/deploy/systemd/README.md @@ -58,5 +58,5 @@ usable there at all, fall back to a crontab entry instead: where you control a dedicated VM/server and need to serve the output yourself. On the ETP login nodes there's no Docker daemon (Apptainer/Singularity only), and `public_html` is already auto-served — running your own nginx there would -be redundant. Docker is still used for CI (`.gitlab-ci.yml`) and remains a fine -option for anyone deploying this on their own server. +be redundant. Docker is still used for CI (`.gitea/workflows/ci.yml`) and +remains a fine option for anyone deploying this on their own server.