UC-68 testing GitLab jobs
This commit is contained in:
parent
8bb811cf1c
commit
64caf4d379
2 changed files with 58 additions and 1 deletions
57
.gitlab-ci.yml
Normal file
57
.gitlab-ci.yml
Normal file
|
|
@ -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
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -1,5 +1,5 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py38,py310
|
envlist = py312
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue