-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
52 lines (47 loc) · 1.34 KB
/
.gitlab-ci.yml
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
52
default:
image: python:3.10-slim
stages:
- linters
- tests
Tests:
stage: tests
services:
- name: bitnami/postgresql:latest
alias: cc_postgres
variables:
POSTGRES_USER: shift_cc
POSTGRES_PASSWORD: shift_cc_pass
POSTGRES_DB: shift_cc_db
before_script:
- apt-get update && apt-get install -y curl
- curl -sSL https://install.python-poetry.org | python3 -
- export PATH="/root/.local/bin:$PATH"
- poetry install
- apt-get -y update && apt-get -y install libgl1
- apt-get -y update && apt-get -y install libglib2.0-0
script:
- poetry run pytest
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "week2_task1"
changes:
- "**/*.py"
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != "week2_task1"
changes:
- "**/*.py"
# when: manual
Linters:
stage: linters
before_script:
- apt-get update && apt-get install -y curl
- curl -sSL https://install.python-poetry.org | python3 -
- export PATH="/root/.local/bin:$PATH"
- poetry install --without ml
script:
- poetry run flake8
- poetry run mypy .
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "week2_task1"
changes:
- "**/*.py"
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != "week2_task1"
when: manual