-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
145 lines (135 loc) · 3.13 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
image: ghcr.io/prefix-dev/pixi:0.39.0
variables:
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fastest"
run tests:
variables:
GIT_STRATEGY: clone
parallel:
matrix:
- PIXI_ENV:
- "mid"
- "latest"
script:
- pixi run -e $PIXI_ENV tests
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
run coverage:
extends: run tests
parallel: null
variables:
PIXI_ENV: "minimal"
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- htmlcov
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
run docs:
script:
- pixi run docs-build
artifacts:
paths:
- docs/build
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
run pre-commit:
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
script:
- pixi run -e precommit git config --global --add safe.directory $CI_PROJECT_DIR
- pixi run pre-commit run --all-files
cache:
key: "$CI_JOB_NAME"
paths:
- .pre-commit-cache
- .pixi
paper:
image: gitlab.kwant-project.org:5005/qt/research-docker
when: manual
before_script: []
script:
- pip install -e .
- cd paper/code_figures
- jupytext --to ipynb --execute *.py
- cd ../figures
- for image in *.svg; do
- inkscape --batch-process -o "${image%.*}.pdf" $image
- done
- cd ..
- sed -i -e "s/\\\usepackage{minted}/\\\usepackage\[finalizecache,cachedir=minted-cache\]{minted}/g" paper.tex
- for tex in *.tex; do
- if grep "documentclass" $tex >/dev/null; then
- latexmk -pdf $tex -shell-escape
- fi
- done
artifacts:
paths:
- paper/paper.pdf
- paper/figures/*.pdf
- paper/*.bbl
- paper/minted-cache/*
pages:
before_script: []
needs:
- run coverage
- run docs
# - paper # Disabled after finishing the manuscript
script:
- mkdir public
- cp -r htmlcov public/
- cp -r docs/build public/
# - cp -r paper/ public/
artifacts:
paths:
- public
prepare zips:
image: gitlab.kwant-project.org:5005/qt/research-docker
before_script: []
when: manual
needs: [paper]
script:
- zip -r zenodo.zip *
- cd paper
- sed -i -e "s/\\\today/$(date +'%B %e, %Y')/g" *.tex
- sed -i -e "s/\\\usepackage{minted}/\\\usepackage\[frozencache,cachedir=minted-cache\]{minted}/g" paper.tex
- zip ../arxiv.zip *.tex *.bbl figures/*.pdf *.cls *.bst minted-cache/*
artifacts:
paths:
- arxiv.zip
- zenodo.zip
publish to test pypi:
needs:
- run tests
- run coverage
- run docs
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*\+test$/' # vX.Y.Z.post1+test
script:
- pixi run build
- pixi run publish -a $PYPI_TEST_TOKEN -r test
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
publish to pypi:
needs:
- run tests
- run coverage
- run docs
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+[^+]*$/' # No +test
script:
- pixi run build
- pixi run publish -a $PYPI_TOKEN
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi