-
Notifications
You must be signed in to change notification settings - Fork 1
243 lines (201 loc) · 7.75 KB
/
codecov.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# Copyright (C) 2023 Roberto Rossini (roberros@uio.no)
# SPDX-License-Identifier: MIT
name: Run Codecov
on:
push:
branches: [ main ]
paths:
- ".github/codecov.yml"
- ".github/workflows/codecov.yml"
- "cmake/**"
- "examples/**"
- "src/**"
- "test/**"
- "CMakeLists.txt"
- "conanfile.txt"
tags:
- 'v*.*.*'
pull_request:
paths:
- ".github/codecov.yml"
- ".github/workflows/codecov.yml"
- "cmake/**"
- "examples/**"
- "src/**"
- "test/**"
- "CMakeLists.txt"
- "conanfile.txt"
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CCACHE_DIR: "/opt/ccache-cache"
CCACHE_COMPILERCHECK: "content"
CCACHE_COMPRESSLEVEL: "13"
CCACHE_MAXSIZE: "200M"
CONAN_HOME: "/opt/conan/"
jobs:
cache-test-dataset:
uses: paulsengroup/hictk/.github/workflows/cache-test-dataset.yml@main
run-codecov:
name: Codecov
needs: cache-test-dataset
runs-on: ubuntu-latest
container:
image: ghcr.io/paulsengroup/ci-docker-images/ubuntu-22.04-cxx-gcc-12
options: '--user=root'
steps:
- uses: actions/checkout@v4
- name: Fix permissions
run: |
chown -R $(id -u):$(id -g) $PWD
- name: Generate cache key
id: cache-key
run: |
hash="${{ hashFiles('conanfile.txt', '.github/workflows/codecov.yml') }}"
# This can be used by to always update a cache entry (useful e.g. for ccache)
current_date="$(date '+%s')"
ccache_key_prefix="codecov-ccache-$hash"
echo "conan-key=codecov-$hash" >> $GITHUB_OUTPUT
echo "ccache-key=${ccache_key_prefix}-${current_date}" >> $GITHUB_OUTPUT
echo "ccache-restore-key=$ccache_key_prefix" >> $GITHUB_OUTPUT
- name: Restore Conan cache
id: cache-conan
uses: actions/cache/restore@v3
with:
key: conan-${{ steps.cache-key.outputs.conan-key }}
path: ${{ env.CONAN_HOME }}
- name: Clean Conan cache (pre-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
conan cache clean "*" --build
conan cache clean "*" --download
conan cache clean "*" --source
conan remove --confirm "*"
- name: Install build dependencies
run: |
conan install . \
--build=missing \
-pr:b="$CONAN_DEFAULT_PROFILE_PATH" \
-pr:h="$CONAN_DEFAULT_PROFILE_PATH" \
-s build_type=Debug \
-s compiler.libcxx=libstdc++11 \
-s compiler.cppstd=17 \
--output-folder=build
- name: Clean Conan cache (post-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
conan cache clean "*" --build
conan cache clean "*" --download
conan cache clean "*" --source
- name: Save Conan cache
uses: actions/cache/save@v3
if: steps.cache-conan.outputs.cache-hit != 'true'
with:
key: conan-${{ steps.cache-key.outputs.conan-key }}
path: ${{ env.CONAN_HOME }}
- name: Configure project
run: |
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="$PWD/build" \
-DENABLE_DEVELOPER_MODE=ON \
-DOPT_ENABLE_COVERAGE=ON \
-DOPT_ENABLE_SANITIZER_ADDRESS=OFF \
-DOPT_ENABLE_SANITIZER_UNDEFINED_BEHAVIOR=OFF \
-DOPT_ENABLE_CLANG_TIDY=OFF \
-DHICTK_BUILD_EXAMPLES=OFF \
-DHICTK_ENABLE_TESTING=ON \
-DHICTK_DOWNLOAD_TEST_DATASET=OFF \
-DHICTK_ENABLE_GIT_VERSION_TRACKING=OFF \
-S . \
-B build
- name: Cache Ccache folder
uses: actions/cache@v3
with:
key: ${{ steps.cache-key.outputs.ccache-key }}
restore-keys: ${{ steps.cache-key.outputs.ccache-restore-key }}
path: ${{ env.CCACHE_DIR }}
- name: Build project
run: cmake --build build -j $(nproc)
- name: Print Ccache statistics
run: ccache -s
- name: Restore test dataset
uses: actions/cache/restore@v3
with:
key: ${{ needs.cache-test-dataset.outputs.cache-key }}
path: test/data/hictk_test_data.tar.xz
fail-on-cache-miss: true
- name: Extract test dataset
run: tar -xf test/data/hictk_test_data.tar.xz
- name: Run unit tests
run: |
ctest --test-dir build/ \
--schedule-random \
--output-on-failure \
--no-tests=error \
--timeout 90 \
-j $(nproc) |&
head -n 1000
- name: Install test dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends default-jdk python3-pip xz-utils
python3 -m pip install 'cooler>=0.9.2'
- name: Cache hic_tools
id: cache-hictools
uses: actions/cache@v3
with:
key: hic_tools
path: hic_tools.jar
- name: Download hic_tools
if: steps.cache-hictools.outputs.cache-hit != 'true'
run: |
apt-get install -y --no-install-recommends curl
curl -L 'https://github.com/aidenlab/HiCTools/releases/download/v3.30.00/hic_tools.3.30.00.jar' \
-o hic_tools.jar
- name: Run integration tests
run: |
test/scripts/hictk_balance.sh build/src/hictk/hictk hic_tools.jar
test/scripts/hictk_dump_chroms.sh build/src/hictk/hictk
test/scripts/hictk_dump_bins.sh build/src/hictk/hictk
test/scripts/hictk_dump_resolutions.sh build/src/hictk/hictk
test/scripts/hictk_dump_normalizations.sh build/src/hictk/hictk
test/scripts/hictk_dump_cells.sh build/src/hictk/hictk
test/scripts/hictk_dump_gw.sh build/src/hictk/hictk
test/scripts/hictk_dump_cis.sh build/src/hictk/hictk
test/scripts/hictk_dump_trans.sh build/src/hictk/hictk
test/scripts/hictk_dump_balanced.sh build/src/hictk/hictk
test/scripts/hictk_convert_hic2cool.sh build/src/hictk/hictk
test/scripts/hictk_convert_cool2hic.sh build/src/hictk/hictk hic_tools.jar
test/scripts/hictk_load_coo.sh build/src/hictk/hictk sorted
test/scripts/hictk_load_coo.sh build/src/hictk/hictk unsorted
test/scripts/hictk_load_bg2.sh build/src/hictk/hictk sorted
test/scripts/hictk_load_bg2.sh build/src/hictk/hictk unsorted
test/scripts/hictk_load_4dn.sh build/src/hictk/hictk sorted
test/scripts/hictk_load_4dn.sh build/src/hictk/hictk unsorted
test/scripts/hictk_merge.sh build/src/hictk/hictk
test/scripts/hictk_validate.sh build/src/hictk/hictk
test/scripts/hictk_zoomify.sh build/src/hictk/hictk
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
gcov: true
gcov_executable: gcov-12
os: linux
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
codecov-status-check:
name: Status Check (Codecov)
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- run-codecov
steps:
- name: Collect job results
if: needs.run-codecov.result != 'success'
run: exit 1