-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (81 loc) · 2.82 KB
/
Copy pathc-cpp.yml
File metadata and controls
94 lines (81 loc) · 2.82 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test-no-tls:
strategy:
matrix:
compiler: [gcc, clang]
runs-on: ubuntu-latest
env:
CC: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake clang
- name: Build and test (no TLS)
run: |
cd tests
cmake -B build
cmake --build build
./build/tests
test-tls-backends:
strategy:
fail-fast: false
matrix:
backend:
- { name: OpenSSL, flag: COMPY_TLS_OPENSSL, pkg: libssl-dev }
- { name: wolfSSL, flag: COMPY_TLS_WOLFSSL, pkg: libwolfssl-dev }
- { name: mbedTLS, flag: COMPY_TLS_MBEDTLS, pkg: libmbedtls-dev }
runs-on: ubuntu-latest
name: test-${{ matrix.backend.name }}
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake libmbedtls-dev ${{ matrix.backend.pkg }}
- name: Build and test (${{ matrix.backend.name }})
env:
LSAN_OPTIONS: suppressions=${{ github.workspace }}/tests/lsan_suppressions.txt
run: |
cd tests
cmake -B build -D${{ matrix.backend.flag }}=ON
cmake --build build
./build/tests
test-tsan:
strategy:
fail-fast: false
matrix:
backend:
- { name: OpenSSL, flag: COMPY_TLS_OPENSSL, pkg: libssl-dev }
- { name: wolfSSL, flag: COMPY_TLS_WOLFSSL, pkg: libwolfssl-dev }
- { name: mbedTLS, flag: COMPY_TLS_MBEDTLS, pkg: libmbedtls-dev }
runs-on: ubuntu-latest
name: tsan-${{ matrix.backend.name }}
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake libmbedtls-dev ${{ matrix.backend.pkg }}
- name: Build and test with TSAN (${{ matrix.backend.name }})
run: |
cd tests
cmake -B build -D${{ matrix.backend.flag }}=ON -DCOMPY_TSAN=ON
cmake --build build
./build/tests
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install clang-format-19
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update && sudo apt-get install -y clang-format-19
- name: Check formatting
run: |
find include src tests -name '*.c' -o -name '*.h' | \
grep -v '/priv/compiler_attrs.h' | \
xargs clang-format-19 --dry-run --Werror