-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
122 lines (105 loc) · 3.05 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
default:
image: python:3.9
tags: [ public-docker ]
stages:
- test
- run
- release
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/topics/caching/
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- python --version # For debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- python -m pip install --upgrade pip
- pip install .
.test:
script:
- pip install pytest pytest-cov # flake8
# - flake8 --max-line-length=120 extrap tests setup.py
- cd tests
- pytest . --ignore-glob=test_gui*.py --doctest-modules --junitxml=junit/test-results.xml --cov --cov-report=xml:junit/coverage.xml --cov-report=html:coverage
artifacts:
when: always
paths:
- tests/junit/test-results.xml
- tests/coverage/*
reports:
junit: tests/junit/test-results.xml
coverage_report:
coverage_format: cobertura
path: tests/junit/coverage.xml
test-3.8:
extends: ".test"
image: "python:3.8"
test-3.9:
extends: ".test"
image: "python:3.9"
test-3.10:
extends: ".test"
image: "python:3.10"
test-3.11:
extends: ".test"
image: "python:3.11"
test-3.12:
extends: ".test"
image: "python:3.12"
test-macos:
extends: ".test"
tags:
- macos
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
before_script:
- brew install [email protected]
- python3.9 --version # For debugging
- python3.9 -m venv venv
- source venv/bin/activate
- python -m pip install --upgrade pip
- pip install .
script:
- pip install pytest pytest-cov
- cd tests
- pytest . --doctest-modules --junitxml=junit/test-results.xml --cov --cov-report=xml:junit/coverage.xml --cov-report=html:coverage
run:
script:
- extrap --version
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+.*/' # Run this job when a tag is created
before_script:
- echo "running release_job"
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
upload_release_job:
stage: release
tags: [ deep-sea, jacamar, shell ]
cache: { }
rules:
- if: '$CI_SERVER_HOST != "gitlab.jsc.fz-juelich.de"'
when: never
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+.*/'
before_script:
- echo "Project located at $CI_PROJECT_DIR"
script:
- mkdir -p /p/project/deepsea/wp2/install_packages/extrap/
- rm -rf .git
- cd ..
- mv "$CI_PROJECT_DIR" "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
- tar -czf "/p/project/deepsea/wp2/install_packages/extrap/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.gz" "$CI_PROJECT_NAME-$CI_COMMIT_TAG"