-
Notifications
You must be signed in to change notification settings - Fork 34
96 lines (79 loc) · 2.52 KB
/
cmake.yml
File metadata and controls
96 lines (79 loc) · 2.52 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
91
92
93
94
95
96
name: CMake
on:
push:
branches: [ "main", "python" ]
paths:
- 'lib/**'
- 'src/**'
- 'tests/**'
- 'CMakeLists.txt'
- '.github/workflows/cmake.yml'
pull_request:
branches: [ "main" ]
paths:
- 'lib/**'
- 'src/**'
- 'tests/**'
- 'CMakeLists.txt'
- '.github/workflows/cmake.yml'
jobs:
build:
name: Build C/C++ on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libomp-dev cmake
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install --formula libomp cmake
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} --parallel 2
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{ matrix.build_type }} --output-on-failure
- name: Test kalign executable
run: |
# Create test input
echo ">seq1" > test.fasta
echo "ATCGATCGATCG" >> test.fasta
echo ">seq2" >> test.fasta
echo "ATCGTCGATCG" >> test.fasta
echo ">seq3" >> test.fasta
echo "ATCGATCATCG" >> test.fasta
# Test kalign executable
./build/src/kalign -i test.fasta -o test_output.fasta
# Verify output exists and is not empty
if [ -f test_output.fasta ] && [ -s test_output.fasta ]; then
echo "✓ kalign executable test passed"
else
echo "✗ kalign executable test failed"
exit 1
fi
address-sanitizer:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libomp-dev cmake
- name: Configure CMake with ASAN
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=ASAN
- name: Build
run: cmake --build ${{github.workspace}}/build --config ASAN --parallel 2
- name: Test with ASAN
working-directory: ${{github.workspace}}/build
run: ctest -C ASAN --output-on-failure