forked from MichaelAmiot/Swamp-Sequencers
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.67 KB
/
Copy pathci.yml
File metadata and controls
90 lines (75 loc) · 2.67 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# A new push to the same branch supersedes any run still in flight.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build the library + GoogleTest suite and run it
# SWAMP_BUILD_TUI=OFF skips FTXUI and, more importantly, the ~5 MB genome
# download NCBI serves at configure time — CI would otherwise fail whenever
# that endpoint is slow or rate-limited. The tests use inline strings only.
test:
name: test (${{ matrix.os }}, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Cache FetchContent dependencies
uses: actions/cache@v4
with:
path: build/_deps
key: deps-${{ matrix.os }}-${{ hashFiles('CMakeLists.txt') }}
- name: Configure
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DSWAMP_BUILD_TUI=OFF
-DSWAMP_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel
- name: Test
run: ctest --test-dir build --build-config ${{ matrix.build_type }} --output-on-failure
# The sanitizer run lives in its own workflow so it reports a separate badge:
# see .github/workflows/sanitizers.yml
#
# Runs a deliberately small sweep so it stays inside a normal CI budget, and
# publishes the CSV as an artifact so the performance tradeoff can be tracked
# across commits rather than measured once and forgotten.
benchmark:
name: benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=Release
-DSWAMP_BUILD_TUI=OFF
-DSWAMP_BUILD_TESTS=OFF
-DSWAMP_BUILD_BENCH=ON
- name: Build
run: cmake --build build --parallel
- name: Run benchmark
run: ./build/bin/SwampBench --max-size 200000 --steps 4 --queries 200 > bench_results.csv
- name: Summarize
run: |
echo '### Suffix Array vs. Suffix Tree' >> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
cat bench_results.csv >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: bench-results
path: bench_results.csv