-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
152 lines (143 loc) · 3.91 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
146
147
148
149
150
151
152
default:
image: rust:latest
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
stages:
- Build
- Unit Tests
- Deploy
check:
stage: Build
tags:
- archon
before_script:
- export RUSTFLAGS="-Cdebuginfo=2 --cfg=tarpaulin"
- apt-get update
- apt-get install gfortran build-essential cmake -y
script:
- cargo check --release --verbose --features full,sandbox --color always
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /\/doc-/
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
unit_tests:
stage: Unit Tests
tags:
- archon
before_script:
- apt-get update
- apt-get install gfortran build-essential cmake -y
script:
- cargo test -r --features full,sandbox -- --include-ignored
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /\/doc-/
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
tarpaulin:
stage: Unit Tests
tags:
- archon
coverage: '/^\d+.\d+% coverage/'
before_script:
- export RUSTFLAGS="-Cdebuginfo=2 --cfg=tarpaulin"
- apt-get update
- apt-get install gfortran build-essential cmake -y
script:
- cargo install cargo-tarpaulin
- cargo tarpaulin -t 1800 --release --workspace --engine llvm --no-dead-code --features full,sandbox --color always
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /\/doc-/
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
cibuildwheel-linux:
stage: Deploy
tags:
- archon
image: python:3.11
services:
- name: docker:20.10.16-dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
- export TAG=$(git describe --tags --abbrev=0)
- echo TAG=$TAG >> cibuildwheel_linux.env
- echo GE_JOB_ID=$CI_JOB_ID >> cibuildwheel_linux.env
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==2.20.0
- cibuildwheel --platform linux --output-dir wheelhouse
- tar -czvf qsym2-$TAG-wheels.tar.gz wheelhouse/*
artifacts:
paths:
- qsym2-*-wheels.tar.gz
expire_in: never
reports:
dotenv: cibuildwheel_linux.env
rules:
- if: $CI_COMMIT_TAG
release:
stage: Deploy
tags:
- archon
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Running `release` job for $TAG..."
release:
name: "Release $TAG"
description: "Release $TAG created using the release-cli provided by GitLab."
ref: "$CI_COMMIT_SHA"
tag_name: "$TAG"
assets:
links:
- name: "Linux Python wheels"
url: "https://gitlab.com/bangconghuynh/qsym2/-/jobs/${GE_JOB_ID}/artifacts/file/qsym2-$TAG-wheels.tar.gz"
rules:
- if: $CI_COMMIT_TAG
needs:
- job: cibuildwheel-linux
artifacts: true
mkdocs:
stage: Deploy
image: python:latest
script:
- pip install "mkdocs-material[imaging]"
- pip install mkdocs-git-revision-date-localized-plugin
- cd docs
- mkdocs build --site-dir public
- cd ..
- mv docs/public .
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /\/doc-/
pages:
stage: Deploy
tags:
- archon
variables:
RUSTDOCFLAGS: --html-in-header katex.html
before_script:
- apt-get update
- apt-get install gfortran build-essential cmake -y
script:
- cargo doc --no-deps --features full,python,sandbox
- mv target/doc public/api
- echo '<meta http-equiv="refresh" content="0; url=qsym2/index.html">' > public/api/index.html
needs:
- job: mkdocs
artifacts: true
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /\/doc-/