Repository navigation
58 lines (53 loc) · 1.57 KB
/
Copy pathci.yml
File metadata and controls
58 lines (53 loc) · 1.57 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
unit-tests:
name: Unit tests and example (${{ matrix.cc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Build libraries, run both test binaries and the example (-Werror)
run: make CC=${{ matrix.cc }}
coverage:
name: Coverage (100% line and branch)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install gcovr
run: sudo apt-get update && sudo apt-get install -y gcovr
- name: Build instrumented tests, report, and enforce 100% line and branch
run: make coverage-html
- name: Upload HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: build/coverage/
if-no-files-found: ignore
sanitizers:
name: ASan + UBSan (${{ matrix.cc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Build and run tests and example under ASan and UBSan
run: make sanitize CC=${{ matrix.cc }}
format:
name: clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: Check formatting against .clang-format
run: git ls-files '*.c' '*.h' | xargs clang-format --dry-run --Werror