-
Notifications
You must be signed in to change notification settings - Fork 4
171 lines (149 loc) · 4.81 KB
/
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Continuous Integration
on:
push:
pull_request:
workflow_call:
defaults:
run:
# This is needed for miniconda, see:
# https://github.com/marketplace/actions/setup-miniconda#important.
shell: bash -l {0}
jobs:
quick-tests:
runs-on: ubuntu-latest
strategy:
matrix:
test:
- sanity
- dry-run
- utilities
- report
- scripts
- docs
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: HAMLET
use-mamba: true
- name: Install singularity
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.7.1
# This is used to invalidate the conda environment every week
- name: Get year and week (for conda cache)
id: get-date
run: echo "week=$(/bin/date -u '+%Y-w%V')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache conda environment
id: conda-cache
uses: actions/cache@v4
env:
# Increase this value to manually invalidate the cache
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ hashFiles('environment.yml') }}-${{ steps.get-date.outputs.week }}-${{ env.CACHE_NUMBER }}
- name: Update HAMLET environment
run: mamba env update -n HAMLET -f environment.yml
if: steps.conda-cache.outputs.cache-hit != 'true'
- name: Run test in conda environment
run: >-
pytest --keep-workflow-wd-on-fail
--tag ${{ matrix.test }}
- name: Check pytest stdout messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp -name log.out);
do echo $file; cat $file; done'
- name: Check pytest stderr messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp -name log.err);
do echo $file; cat $file; done'
functional-tests:
needs: quick-tests
runs-on: ubuntu-latest
strategy:
matrix:
module:
- qc-seq
- snv-indels
- itd
- fusion
- test-hamlet-targetted-RNA
- test-hamlet-chrM
steps:
- name: Maximise build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 30720
swap-size-mb: 1024
remove-android: 'true'
remove-dotnet: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: HAMLET
use-mamba: true
# This is used to invalidate the conda environment every week
- name: Get week number
id: get-date
run: echo "week=$(/bin/date -u '+%Y-w%V')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache conda environment
id: conda-cache
uses: actions/cache@v4
env:
# Increase this value to manually invalidate the cache
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ hashFiles('environment.yml') }}-${{ steps.get-date.outputs.week }}-${{ env.CACHE_NUMBER }}
- name: Update HAMLET environment
run: mamba env update -n HAMLET -f environment.yml
if: steps.conda-cache.outputs.cache-hit != 'true'
- name: Install singularity
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.7.1
- name: Cache singularity images
uses: actions/cache@v3
env:
# Increase this value to manually invalidate the cache
CACHE_NUMBER: 0
with:
path:
~/.singularity/cache/snakemake
key: singularity-${{ hashFiles('**/common.smk') }}-${{ matrix.module}}-${{ env.CACHE_NUMBER }}
restore-keys: |
singularity-${{ hashFiles('**/common.smk') }}-
singularity-
- name: Run test in conda environment
run: >-
pytest --keep-workflow-wd-on-fail
--tag ${{ matrix.module}}
--tag functional
- name: Check pytest stdout messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp -name log.out);
do echo $file; cat $file; done'
- name: Check pytest stderr messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp -name log.err);
do echo $file; cat $file; done'