From 64caf4d3796ac00b7234c720a94cfaa36a8485d7 Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Thu, 26 Feb 2026 17:06:41 +1300 Subject: [PATCH 1/2] UC-68 testing GitLab jobs --- .gitlab-ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b50e2f3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +stages: + - lint + - test + +.venv-job: + before_script: + - uv venv -p 3.12 .venv + - source .venv/bin/activate + - uv pip install -r requirements-dev.txt + cache: + paths: + - .venv + +# TODO: this is still fictional, but an example of how to prep a docker job in GitLab +.docker-job: + tags: + - docker + before_script: + - docker compose build + - docker compose down --remove-orphans --volumes # Ensures empty database always created with .env DB_PASSWORD + - docker compose run postgres bash -c "bin/restore-test-database.sh" + +# ----------------------------------------------------------------- +# Run some basic linting in parallel + +lint:flakes: + stage: lint + only: + - pushes + extends: .venv-job + script: + - uv pip install flake8 + - flake8 $(git ls-files|grep py$) + +# lint:ruff: +# stage: lint +# only: +# - pushes +# extends: .venv-job +# script: +# - ruff check +# +# lint:gitleaks: +# stage: lint +# only: +# - pushes +# extends: .venv-job +# script: +# - gitleaks git + +test:test: + stage: test + only: + - pushes + extends: .venv-job + script: + - tox diff --git a/tox.ini b/tox.ini index e286263..0ae07c3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py310 +envlist = py312 skipsdist = True skip_missing_interpreters = True From 76e85baf8389668a21a216c6767d05c749c03e85 Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Thu, 26 Feb 2026 17:33:14 +1300 Subject: [PATCH 2/2] fixes --- .gitlab-ci.yml | 17 ++++++++++++++++- docs/source/conf.py | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b50e2f3..45e8604 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: .venv-job: before_script: - - uv venv -p 3.12 .venv + - uv venv -p 3.12 --clear .venv - source .venv/bin/activate - uv pip install -r requirements-dev.txt cache: @@ -32,6 +32,7 @@ lint:flakes: - uv pip install flake8 - flake8 $(git ls-files|grep py$) + # lint:ruff: # stage: lint # only: @@ -53,5 +54,19 @@ test:test: only: - pushes extends: .venv-job + variables: + PYTHONDONTWRITEBYTECODE: 1 + PYTHONUNBUFFERED: 1 script: - tox + coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' + artifacts: + when: always + paths: + - junit.xml + - coverage.xml + reports: + junit: junit.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml diff --git a/docs/source/conf.py b/docs/source/conf.py index 270dde4..fbd7952 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -5,7 +5,7 @@ For the full list of built-in configuration values, see the """ import sys -import sphinx_rtd_theme +# import sphinx_rtd_theme from pathlib import Path