-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
51 lines (47 loc) · 1.43 KB
/
.gitlab-ci.yml
File metadata and controls
51 lines (47 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_REF_NAME !~ /^(release\/.*|dev|master|main)$/
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_REF_NAME =~ /^(release\/.*|dev|master|main)$/
- if: "$CI_COMMIT_TAG"
image: ghcr.io/astral-sh/uv:python3.14-bookworm
stages:
- static
- test
- build
lint:
stage: static
interruptible: true
before_script:
- uv sync --locked --only-group=dev
script:
- make lint
unit:
stage: test
interruptible: true
coverage: "/\\d+.\\d+\\%\\s*$/"
before_script:
- uv sync --locked --all-extras
script:
- make test
needs:
- lint
docker:prebuild:
image: docker:latest
interruptible: true
stage: build
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --progress plain --build-arg VERSION=$CI_COMMIT_SHORT_SHA --build-arg BRANCH=$CI_COMMIT_REF_SLUG --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:latest -f ./docker/production/app/Dockerfile .
after_script:
- docker rmi --force $(docker images $CI_REGISTRY_IMAGE -a -q)
- docker logout
needs:
- unit
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_REF_NAME !~ /^(release\/.*|dev|master|main)$/
changes:
- docker/production/**/*
- uv.lock