-
Notifications
You must be signed in to change notification settings - Fork 17
94 lines (88 loc) · 2.94 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
name: CI
on: [push, pull_request]
defaults:
run:
shell: bash # For -o pipefail
jobs:
lint:
# Run for PRs only if they come from a forked repo (avoids duplicate runs)
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for tab characters
run: "! grep -P -R '\\t' src/ tests/*.{cpp,py}"
build:
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd build
make -j3
make install
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get install samtools
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install samtools
- name: Run
run: tests/run.sh
pythonbindings:
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python dependencies
run: pip install pytest
- name: Install Python bindings
run: pip install .
- name: Run tests
run: pytest tests
compare:
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Baseline comparison needs older commits
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get install samtools python3-pysam picard-tools
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install samtools pysam picard-tools
- name: Cache test dataset
uses: actions/cache@v4
with:
key: test-data-${{ hashFiles('tests/download.sh') }}
path: tests/drosophila/
- name: Cache baseline BAM
id: cache-baseline-bam
uses: actions/cache@v4
with:
key: baseline-bam-${{ hashFiles('tests/baseline-commit.txt') }}
path: baseline/bam/
- name: Compare to baseline
run: tests/compare-baseline.sh
- name: Validate with Picard
run: |
PicardCommandLine ValidateSamFile IGNORE=RECORD_MISSING_READ_GROUP IGNORE=MISSING_READ_GROUP I=head.bam