-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from OpenBrickProtocolFoundation/clang-build-a…
…nd-ci Clang build and ci
- Loading branch information
Showing
8 changed files
with
123 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: C++ CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- compiler-name: GCC 13 | ||
cc: gcc-13 | ||
cxx: g++-13 | ||
install-script: | | ||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
sudo apt update | ||
sudo apt install -y g++-13 | ||
build-type: Debug | ||
- compiler-name: GCC 13 | ||
cc: gcc-13 | ||
cxx: g++-13 | ||
install-script: | | ||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
sudo apt update | ||
sudo apt install -y g++-13 | ||
build-type: Release | ||
- compiler-name: Clang 18 | ||
cc: clang-18 | ||
cxx: clang++-18 | ||
install-script: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh 18 | ||
sudo apt install libstdc++-13-dev | ||
build-type: Debug | ||
- compiler-name: Clang 18 | ||
cc: clang-18 | ||
cxx: clang++-18 | ||
install-script: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh 18 | ||
sudo apt install libstdc++-13-dev | ||
build-type: Release | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install compiler (${{ matrix.compiler-name }}) | ||
run: | | ||
${{ matrix.install-script }} | ||
- name: Configure CMake | ||
run: | | ||
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/${{ matrix.cc }} 100 | ||
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/${{ matrix.cxx }} 100 | ||
cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | ||
- name: Fix kernel mmap rnd bits | ||
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with | ||
# high-entropy ASLR in much newer kernels that GitHub runners are | ||
# using leading to random crashes: https://reviews.llvm.org/D148280 | ||
run: sudo sysctl vm.mmap_rnd_bits=28 | ||
- name: Build | ||
run: cmake --build build | ||
- name: Install | ||
run: cmake --install build --prefix install | ||
- name: Run Tests | ||
run: ctest --test-dir build --verbose --output-on-failure | ||
|
||
build-windows: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
build-type: [ Debug, Release ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Ninja | ||
run: choco install ninja | ||
- name: Install CMake | ||
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' | ||
- name: Set up Visual Studio Environment | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x64 | ||
- name: Configure CMake with Ninja and C++23 | ||
run: cmake -B build -G "Ninja" -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | ||
- name: Build with Ninja | ||
run: cmake --build build | ||
- name: Install | ||
run: cmake --install build --prefix install | ||
- name: Run Tests | ||
run: ctest --test-dir build --verbose --output-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,4 +111,8 @@ class LockDelayState final { | |
} | ||
return LockDelayPollResult::ShouldNotLock; | ||
} | ||
|
||
void clear() { | ||
*this = {}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters