forked from bioconda/bioconda-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipeline.yml
204 lines (176 loc) · 7.54 KB
/
azure-pipeline.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
pr:
autoCancel: true
trigger:
branches:
exclude:
- master
- "*"
stages:
- stage: "lint"
jobs:
- job: "lint"
pool:
vmImage: "ubuntu-latest"
strategy:
maxParallel: 8
steps:
- bash: echo "##vso[task.prependpath]/opt/mambaforge/bin"
displayName: Add conda to PATH
- bash: |
wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh
displayName: Fetch bioconda install script
- bash: |
sudo mkdir -p /opt
sudo chown -R $USER /opt
displayName: Ensure cache has path to restore to
- task: Cache@2
inputs:
path: "/opt/mambaforge"
key: '"$(Agent.OS)" | install-and-set-up-conda.sh | configure-conda.sh | common.sh'
cacheHitVar: CACHE_RESTORED
displayName: Restore cache
- script: bash install-and-set-up-conda.sh
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Install bioconda-utils
# We reconfigure conda to use the right channel setup.
# This has to be done after the cache is restored, because
# the channel setup is not cached as it resides in the home directory.
# We could use a system-wide (and therefore cached) channel setup,
# but mamba does not support that at the time of implementation
# (it ignores settings made by --system).
- script: bash configure-conda.sh
displayName: Configure conda
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate bioconda
source=`echo $(Build.SourceBranch) | sed -e "s#^refs/pull/#pull/#"`
bioconda-utils lint --loglevel debug --full-report --git-range origin/"$SYSTEM_PULLREQUEST_TARGETBRANCH" "$source"
displayName: Lint
- stage: "test_linux"
jobs:
- job: "test_linux"
pool:
vmImage: "ubuntu-latest"
strategy:
maxParallel: 8
timeoutInMinutes: 360
steps:
- bash: echo "##vso[task.prependpath]/opt/mambaforge/bin"
displayName: Add conda to PATH
- bash: |
wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh
displayName: Fetch bioconda install script
- bash: |
sudo mkdir -p /opt
sudo chown -R $USER /opt
displayName: Ensure cache has path to restore to
- task: Cache@2
inputs:
path: "/opt/mambaforge"
key: '"$(Agent.OS)" | install-and-set-up-conda.sh | configure-conda.sh | common.sh'
cacheHitVar: CACHE_RESTORED
displayName: Restore cache
- script: bash install-and-set-up-conda.sh
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Install bioconda-utils
# We reconfigure conda to use the right channel setup.
# This has to be done after the cache is restored, because
# the channel setup is not cached as it resides in the home directory.
# We could use a system-wide (and therefore cached) channel setup,
# but mamba does not support that at the time of implementation
# (it ignores settings made by --system).
- script: bash configure-conda.sh
displayName: Configure conda
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate bioconda
docker pull quay.io/dpryan79/mulled_container:latest
export OSTYPE="linux-gnu"
export CI="true"
bioconda-utils build recipes config.yml \
--docker --mulled-test \
--git-range origin/"$SYSTEM_PULLREQUEST_TARGETBRANCH" HEAD
docker rmi quay.io/dpryan79/mulled_container:latest
displayName: Test
- bash: |
(
mkdir -p /tmp/artifacts/packages
cd /opt/mambaforge/envs/bioconda/conda-bld || exit 0
find -name .cache | xargs rm -rf || true
for n in index.html channeldata.json linux-64 osx-64 noarch; do
cp -rv $n /tmp/artifacts/packages || true
done
if command -V docker >/dev/null; then
mkdir -p /tmp/artifacts/images
cd /tmp/artifacts/images
docker image ls --format='{{.Repository}}:{{.Tag}}' | \
{ grep biocontainers || true ; } | \
xargs -n1 -P4 bash -c '
test -n "${1+x}" || exit 0
echo "Start compressing docker image ${1} ..."
docker save "${1}" | gzip -c > "${1##*/}.tar.gz"
echo "Finished compressing docker image ${1} ."
' --
fi
) || true
displayName: Prepare artifacts
- publish: /tmp/artifacts
artifact: LinuxArtifacts
- stage: "test_osx"
jobs:
- job: "test_osx"
pool:
vmImage: "macOS-latest"
strategy:
maxParallel: 4
timeoutInMinutes: 360
steps:
- bash: echo "##vso[task.prependpath]/opt/mambaforge/bin"
displayName: Add conda to PATH
- bash: |
wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh
displayName: Fetch setup scripts
- bash: |
sudo mkdir -p /opt
sudo chown -R $USER /opt
displayName: Ensure cache has path to restore to
- task: Cache@2
inputs:
path: "/opt/mambaforge"
key: '"$(Agent.OS)" | install-and-set-up-conda.sh | configure-conda.sh | common.sh'
cacheHitVar: CACHE_RESTORED
displayName: Restore cache
- script: bash install-and-set-up-conda.sh
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Install bioconda-utils
# We reconfigure conda to use the right channel setup.
# This has to be done after the cache is restored, because
# the channel setup is not cached as it resides in the home directory.
# We could use a system-wide (and therefore cached) channel setup,
# but mamba does not support that at the time of implementation
# (it ignores settings made by --system).
- script: bash configure-conda.sh
displayName: Configure conda
- bash: |
set -e
eval "$(conda shell.bash hook)"
conda activate bioconda
export OSTYPE="darwin"
export CI="true"
bioconda-utils build recipes config.yml \
--git-range origin/"$SYSTEM_PULLREQUEST_TARGETBRANCH" HEAD
displayName: Test
- bash: |
(
mkdir -p /tmp/artifacts/packages
cd /opt/mambaforge/envs/bioconda/conda-bld || exit 0
find -name .cache | xargs rm -rf || true
for n in index.html channeldata.json linux-64 osx-64 noarch; do
cp -rv $n /tmp/artifacts/packages || true
done
) || true
displayName: Prepare artifacts
- publish: /tmp/artifacts
artifact: OSXArtifacts