Skip to content

Commit 2f0db20

Browse files
committed
Rewritten CI from scratch
1 parent ac71f4d commit 2f0db20

11 files changed

Lines changed: 278 additions & 224 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Code Format
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '!**'
8+
- '**.h'
9+
- '**.cc'
10+
- .github/workflows/check-code-format.yml
11+
pull_request:
12+
branches: [ master ]
13+
paths:
14+
- '!**'
15+
- '**.h'
16+
- '**.cc'
17+
- .github/workflows/check-code-format.yml
18+
19+
jobs:
20+
check-code-format:
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v6
25+
26+
- name: Install clang-format
27+
env:
28+
CLANG_FORMAT_VERSION: 22
29+
run: |
30+
UBUNTU_CODENAME=$(. /etc/os-release && echo $VERSION_CODENAME)
31+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
32+
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_FORMAT_VERSION} main" | sudo tee /etc/apt/sources.list.d/llvm.list
33+
echo "deb-src http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_FORMAT_VERSION} main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
34+
sudo apt-get update
35+
sudo apt-get install clang-format-${CLANG_FORMAT_VERSION}
36+
sudo ln -s -f /usr/bin/clang-format-${CLANG_FORMAT_VERSION} /usr/bin/clang-format
37+
clang-format --version
38+
39+
- name: Check code format
40+
run: |
41+
find . -type f \( -name "*.h" -o -name "*.cc" \) > source_files.txt
42+
clang-format --dry-run --Werror --verbose --files=source_files.txt

.github/workflows/ci-linux.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Linux Continuous Integrations
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '!**'
8+
- '**.h'
9+
- '**.cc'
10+
- Makefile
11+
- 'meson*'
12+
- '**/CMakeLists.txt'
13+
- .github/workflows/ci-linux.yml
14+
pull_request:
15+
branches: [ master ]
16+
paths:
17+
- '!**'
18+
- '**.h'
19+
- '**.cc'
20+
- Makefile
21+
- 'meson*'
22+
- '**/CMakeLists.txt'
23+
- .github/workflows/ci-linux.yml
24+
25+
jobs:
26+
ci-linux:
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm]
31+
compiler:
32+
- {c: gcc, cpp: g++}
33+
- {c: clang, cpp: clang++}
34+
sanitize: [address, undefined, thread]
35+
build_system: [cmake, meson]
36+
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v6
42+
43+
- name: Install dependencies
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install --yes -qq meson libboost-all-dev
47+
48+
- name: Build and test with CMake
49+
if: matrix.build_system == 'cmake'
50+
env:
51+
CC: ${{ matrix.compiler.c }}
52+
CXX: ${{ matrix.compiler.cpp }}
53+
run: |
54+
cmake -S . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_CXX_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_EXE_LINKER_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DATOMIC_QUEUE_BUILD_TESTS=ON -DATOMIC_QUEUE_BUILD_EXAMPLES=ON
55+
cmake --build build --target all
56+
ctest --test-dir build --output-on-failure
57+
58+
- name: Build and test with Meson
59+
if: matrix.build_system == 'meson'
60+
env:
61+
CC: ${{ matrix.compiler.c }}
62+
CXX: ${{ matrix.compiler.cpp }}
63+
run: |
64+
meson setup build -Dwerror=true -Dwarning_level=3 -Db_sanitize=${{ matrix.sanitize }}
65+
meson compile -C build
66+
meson test -C build --print-errorlogs
67+
68+
ci-linux-makefile:
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
toolset: [gcc, clang]
73+
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
74+
75+
runs-on: ${{ matrix.os }}
76+
77+
steps:
78+
- uses: actions/checkout@v6
79+
80+
- name: Install Boost.Test
81+
run: |
82+
sudo apt-get update
83+
sudo apt-get install --yes -qq libboost-test-dev
84+
85+
- name: Environment variables
86+
run: make -r TOOLSET=${{ matrix.toolset }} env
87+
88+
- name: Toolset versions
89+
run: make -r TOOLSET=${{ matrix.toolset }} versions
90+
91+
- name: Build and run unit tests
92+
run: make -rj2 TOOLSET=${{ matrix.toolset }} example run_tests
93+
94+
- name: Build and run unit tests with address sanitizer
95+
run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize2 run_tests
96+
97+
- name: Build and run unit tests with thread sanitizer
98+
run: make -rj2 TOOLSET=${{ matrix.toolset }} BUILD=sanitize run_tests

.github/workflows/ci-macos.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: macOS Continuous Integrations
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '!**'
8+
- '**.h'
9+
- '**.cc'
10+
- 'meson*'
11+
- '**/CMakeLists.txt'
12+
- .github/workflows/ci-macos.yml
13+
pull_request:
14+
branches: [ master ]
15+
paths:
16+
- '!**'
17+
- '**.h'
18+
- '**.cc'
19+
- 'meson*'
20+
- '**/CMakeLists.txt'
21+
- .github/workflows/ci-macos.yml
22+
23+
jobs:
24+
ci-macos:
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os: [macos-26, macos-26-intel]
29+
compiler:
30+
- {c: clang, cpp: clang++}
31+
sanitize: [address, undefined, thread]
32+
build_system: [cmake, meson]
33+
34+
runs-on: ${{ matrix.os }}
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v6
39+
40+
- name: Install dependencies
41+
run: |
42+
brew install meson boost
43+
44+
- name: Build and test with CMake
45+
if: matrix.build_system == 'cmake'
46+
env:
47+
CC: ${{ matrix.compiler.c }}
48+
CXX: ${{ matrix.compiler.cpp }}
49+
run: |
50+
cmake -S . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_CXX_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DCMAKE_EXE_LINKER_FLAGS_INIT="-fsanitize=${{ matrix.sanitize }}" -DATOMIC_QUEUE_BUILD_TESTS=ON -DATOMIC_QUEUE_BUILD_EXAMPLES=ON
51+
cmake --build build --target all
52+
ctest --test-dir build --output-on-failure
53+
54+
- name: Build and test with Meson
55+
if: matrix.build_system == 'meson'
56+
env:
57+
CC: ${{ matrix.compiler.c }}
58+
CXX: ${{ matrix.compiler.cpp }}
59+
run: |
60+
meson setup build -Dwerror=true -Dwarning_level=3 -Db_sanitize=${{ matrix.sanitize }}
61+
meson compile -C build
62+
meson test -C build --print-errorlogs

.github/workflows/ci-meson.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/ci-windows.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Windows Continuous Integrations
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '!**'
8+
- '**.h'
9+
- '**.cc'
10+
- '**/CMakeLists.txt'
11+
- .github/workflows/ci-windows.yml
12+
pull_request:
13+
branches: [ master ]
14+
paths:
15+
- '!**'
16+
- '**.h'
17+
- '**.cc'
18+
- '**/CMakeLists.txt'
19+
- .github/workflows/ci-windows.yml
20+
21+
jobs:
22+
ci-windows:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [windows-2025, windows-2022]
27+
build_system: [cmake]
28+
29+
runs-on: ${{ matrix.os }}
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v6
34+
35+
- name: Install boost
36+
uses: MarkusJx/install-boost@v2.6.0
37+
id: install-boost-windows
38+
with:
39+
boost_version: 1.89.0
40+
platform_version: 2022
41+
toolset: msvc
42+
43+
- name: Build and test with CMake
44+
if: matrix.build_system == 'cmake'
45+
run: |
46+
cmake -S . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT="${{steps.install-boost-windows.outputs.BOOST_ROOT}}" -DATOMIC_QUEUE_BUILD_TESTS=ON -DATOMIC_QUEUE_BUILD_EXAMPLES=ON
47+
cmake --build build --target all
48+
ctest --test-dir build --output-on-failure

.github/workflows/ci.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)