-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
94 lines (86 loc) · 2.07 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
#https://computing.docs.ligo.org/gitlab-ci-templates/
#https://github.com/conda/conda-build/issues/4976
include:
- local: '.gitlab/conda.yml'
stages:
- test
- build
default:
image: condaforge/miniforge3:latest
#image: continuumio/miniconda3:latest
# cache is slow for many files
# cache:
# key:
# files:
# - environment.yml
# paths:
# - .env/
.parallel-hidden-job:
extends:
- .conda:base
before_script:
- !reference [ ".conda:base", before_script ]
- echo "Current directory is $(pwd)"
- echo "HOME is $HOME"
- echo "PATH is $PATH"
- echo "User is $USER"
- echo "Hostname is $(hostname)"
parallel:
matrix:
- VERSION: [ '38', '311' ]
#build-job:
# extends: .parallel-hidden-job
# stage: test
# when: manual
# script:
# - python3 -V
# - python3 -m pip install virtualenv
# - rm -rf venv$VERSION
# - virtualenv venv$VERSION
# - source venv$VERSION/bin/activate
# - echo "Building and setting up"
# - python3 -m pip install pytest
# - pip install -r requirements.txt
test-job-conda:
stage: test
extends: .parallel-hidden-job
script:
- python3 -V
- conda -V
- rm -rf .env$VERSION
- echo "Building and setting up from environment.yml"
- conda env create -f .gitlab/environment$VERSION.yml -n venv$VERSION
- conda activate venv$VERSION
- pip install pytest
- pip install --no-dependencies .
- echo "Running tests"
- conda activate venv$VERSION
- pytest -rxs
- echo "Done"
conda-build:
stage: build
extends:
- .conda:build
variables:
MAMBABUILD: "true"
wheel-build:
stage: build
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
script:
- python3 -V
- python3 -m pip install virtualenv
- rm -rf venv
- virtualenv venv
- source venv/bin/activate
- echo "Building and setting up"
- python3 -m pip install -r requirements.txt
- python3 -m pip install 'build[virtualenv]'
- python3 -m build
- echo "Done wheel build"
artifacts:
paths:
- dist/*.whl