-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
120 lines (102 loc) · 3.23 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
image: $IMAGE
stages:
- test
- build
- deploy
# Install a particular Python and set PYTHON envvar for Makefile
.install-pyenv: &install-pyenv |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${PYENV_VERSION}
export PYTHON=$(PYENV_VERSION=$PYENV_VERSION pyenv which python)
.preparetest: &preparetest
stage: test
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq
- apt-get install -y -qq
gcc make cmake curl wget git sqlite3 libsqlite3-dev
zlib1g-dev libbz2-dev libreadline-dev libssl-dev libffi-dev
- *install-pyenv
.minimal-python: &minimal-python
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq && apt-get install -y -qq
python3-all-dev python3-venv
# medaka test suite on various Pythons
.pytest: &pytest
<<: *preparetest
script:
- make flake8 test
test-3.7.9:
variables:
PYENV_VERSION: 3.7.9
<<: *pytest
test-3.8.7:
variables:
PYENV_VERSION: 3.8.7
<<: *pytest
test-3.9.16:
variables:
PYENV_VERSION: 3.9.16
<<: *pytest
test-3.10.9:
variables:
PYENV_VERSION: 3.10.9
<<: *pytest
###
# Source distribution
#
build:sdist:
stage: build
<<: *minimal-python
script:
- make sdist
artifacts:
paths:
- dist/*.tar.gz
###
# Deploy stages
#
# Send all tags to PyPI
deploy:pypi:
stage: deploy
<<: *minimal-python
script:
- make pypi_build/bin/activate
- source pypi_build/bin/activate
- twine upload dist/*.tar.gz
only:
- tags
# Send all tags matching vX.Y.Z to github (code and release)
push-github:
stage: deploy
before_script:
- apt-get update -qq && apt-get install -y -qq
git python3-all-dev python3-venv git-lfs
- mkdir ~/.ssh/
- cp $RESEARCH_BOT_GH_KEY ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n\tHostname ssh.github.com\n\tPort 443\n\n" > ~/.ssh/config
- git config --global user.email "research.git@nanoporetech.com"
- git config --global user.name "ontresearch"
script:
# Push master and tag to github
- git remote add ont ${CI_REPOSITORY_URL} || true
- git remote add github git@github.com:nanoporetech/${CI_PROJECT_NAME}.git || true
- git fetch ont dev --tags
- git checkout ${CI_COMMIT_TAG}
- git branch -D master || echo "No master branch to delete"
- git checkout -b master
- git push -f github master
- git push github ${CI_COMMIT_TAG}
# Make a github release page
- python3 -m venv release_env --prompt "(release) "
- source release_env/bin/activate
- pip install pip --upgrade
- pip install git+https://github.com/epi2me-labs/github_release.git
- github_release ${CI_PROJECT_NAME} ${CI_COMMIT_TAG} CHANGELOG.md ${RESEARCH_BOT_GH_TOKEN} --artifacts dist/*.tar.gz
only:
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
except:
- branches