-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 2.05 KB
/
Copy pathc-cpp.yml
File metadata and controls
63 lines (60 loc) · 2.05 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
name: C/C++ CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup
run: cd tests/data && bash setup.bash
- name: build
run: mkdir build && cd build && cmake .. && make -j `nproc`
- name: build_asan
run: mkdir build_asan && cd build_asan && cmake -DENABLE_ASAN=ON .. && make -j `nproc`
- name: build_tsan
run: mkdir build_tsan && cd build_tsan && cmake -DENABLE_TSAN=ON .. && make -j `nproc`
- name: build_ubsan
run: mkdir build_ubsan && cd build_ubsan && cmake -DENABLE_UBSAN=ON .. && make -j `nproc`
- name: Upload builds
uses: actions/upload-artifact@v4
with:
name: builds
path: build*
test:
runs-on: ubuntu-latest
needs: build
env:
ILIAD_TEST: tests/data/iliad.data
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: builds
path: builds
- name: setup data
run: |
cd tests/data && bash setup.bash
- name: test
run: |
export ILIAD_FILE=${PWD}/$ILIAD_TEST
cd builds/build
chmod +x tests/tests
tests/tests
- name: test_ubsan
run: |
export ILIAD_FILE=${PWD}/$ILIAD_TEST
cd builds/build_ubsan
chmod +x tests/tests
tests/tests
format:
runs-on: ubuntu-latest
steps:
- name: Install clang-format
run: sudo apt install -y clang-format
- uses: actions/checkout@v4
- name: Check clang-format
run: find ./ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -n --Werror