-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (136 loc) · 4.69 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request:
paths-ignore:
- README.md
workflow_dispatch:
jobs:
generate-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- id: set
run: |
echo "version=$(./devel/generate-version)" | tee -a "$GITHUB_OUTPUT"
echo "label=$(./devel/label-for-ref "$GITHUB_REF")" | tee -a "$GITHUB_OUTPUT"
outputs:
version: ${{ steps.set.outputs.version }}
label: ${{ steps.set.outputs.label }}
build-and-test:
needs: generate-version
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
name: build and test (os=${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Install Micromamba
run: |
curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash
echo ~/.local/bin >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- run: ./devel/setup
- run: ./devel/build
env:
VERSION: ${{ needs.generate-version.outputs.version }}
- if: always()
uses: actions/upload-artifact@v4
with:
name: build-outputs-${{ matrix.os }}
path: |
build/
locked/
- if: always()
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os }}
path: build/locked/*/nextstrain-base-*.conda
- name: Test install of nextstrain-base
run: |
micromamba create \
--yes \
--prefix ./test-env \
--strict-channel-priority \
--override-channels \
--channel ./build/locked \
--channel conda-forge \
--channel bioconda \
nextstrain-base
- name: Generate summary
run: |
./devel/download-latest
./devel/diff-pkgs nextstrain-base-*.conda build/locked/*/nextstrain-base-*.conda \
> "$GITHUB_STEP_SUMMARY"
release:
needs:
- generate-version
- build-and-test
runs-on: ubuntu-22.04
steps:
- name: Install Micromamba
run: |
curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash
echo ~/.local/bin >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- uses: actions/upload-artifact/merge@v4
with:
name: packages
pattern: packages-*
- uses: actions/download-artifact@v4
with:
name: packages
path: build/locked/
- run: ./devel/setup
- run: ./devel/upload
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
LABEL: ${{ needs.generate-version.outputs.label }}
- name: Generate summary
run: |
# Replace ${x} in Markdown with value of environment variable "x".
perl -pe 's/\$\{(.+?)\}/$ENV{$1}/ge' \
< .github/workflows/ci.release.md \
> "$GITHUB_STEP_SUMMARY"
env:
VERSION: ${{ needs.generate-version.outputs.version }}
LABEL: ${{ needs.generate-version.outputs.label }}
# Run pathogen repo CI builds with the final packages
test-pathogen-repo-ci:
needs:
- generate-version
- release
strategy:
# XXX TODO: Test on multiple platforms (os, maybe arch) via the matrix too
matrix:
include:
- { pathogen: avian-flu, build-args: auspice/flu_avian_h5n1_ha.json }
- { pathogen: ebola }
- { pathogen: lassa }
- { pathogen: mumps }
- { pathogen: ncov, build-args: all_regions -j 2 --profile nextstrain_profiles/nextstrain-ci }
- { pathogen: rsv }
- { pathogen: seasonal-flu, build-args: --configfile profiles/ci/builds.yaml -p }
# Disable some pathogens until pathogen-repo-ci supports custom build directories
# TODO: Re-enable once issue is resolved: https://github.com/nextstrain/.github/issues/63
# - { pathogen: mpox }
# - { pathogen: zika }
name: test-pathogen-repo-ci (${{ matrix.pathogen }})
uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@master
with:
repo: nextstrain/${{ matrix.pathogen }}
build-args: ${{ matrix.build-args }}
runtimes: |
- conda
env: |
NEXTSTRAIN_CONDA_CHANNEL: nextstrain/label/${{ needs.generate-version.outputs.label }}
NEXTSTRAIN_CONDA_BASE_PACKAGE: nextstrain-base ==${{ needs.generate-version.outputs.version }}
artifact-name: ${{ matrix.pathogen }}-outputs
continue-on-error: true