-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-flows
- Loading branch information
Showing
3 changed files
with
117 additions
and
1 deletion.
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,79 @@ | ||
name: CI Tests | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build: | ||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {name: "Ubuntu Clang 17", os: ubuntu-24.04, toolchain: "clang-17-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "} | ||
- {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18-toolchain.cmake", clang_version: 18, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "} | ||
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options. | ||
- {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19-toolchain.cmake", clang_version: 19, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"} | ||
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "} | ||
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
- uses: seanmiddleditch/gha-setup-ninja@master | ||
- name: Activate verbose shell | ||
run: set -x | ||
- name: Install LLVM+Clang | ||
if: startsWith(matrix.config.os, 'ubuntu-') | ||
run: | | ||
set -x | ||
cat /etc/lsb-release | ||
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \ | ||
lldb-${{matrix.config.installed_clang_version}} \ | ||
lld-${{matrix.config.installed_clang_version}} \ | ||
clangd-${{matrix.config.installed_clang_version}} \ | ||
clang-tidy-${{matrix.config.installed_clang_version}} \ | ||
clang-format-${{matrix.config.installed_clang_version}} \ | ||
clang-tools-${{matrix.config.installed_clang_version}} \ | ||
llvm-${{matrix.config.installed_clang_version}}-dev \ | ||
lld-${{matrix.config.installed_clang_version}} \ | ||
lldb-${{matrix.config.installed_clang_version}} \ | ||
llvm-${{matrix.config.installed_clang_version}}-tools \ | ||
libomp-${{matrix.config.installed_clang_version}}-dev \ | ||
libc++-${{matrix.config.installed_clang_version}}-dev \ | ||
libc++abi-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-common-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-cpp${{matrix.config.installed_clang_version}}-dev \ | ||
libunwind-${{matrix.config.installed_clang_version}}-dev | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh ${{matrix.config.clang_version}} all | ||
sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1 | ||
- name: Install GCC 14 | ||
if: matrix.config.name == 'Ubuntu GCC 14' | ||
run: | | ||
set -x | ||
sudo apt update | ||
sudo apt-get install g++-14 | ||
- name: Configure | ||
run: | | ||
set -x | ||
rm -rf .build | ||
mkdir -p .build | ||
cd .build | ||
echo ${{ matrix.config.cmake_args }} | ||
echo ${{ matrix.config.toolchain }} | ||
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE=etc/${{ matrix.config.toolchain }} -B . -S .. | ||
- name: Build | ||
run: | | ||
set -x | ||
cmake --build .build --config Asan --target all -- -k 0 | ||
- name: Test | ||
run: | | ||
set -x | ||
cd .build | ||
[[ ! -z "${{ matrix.config.asan_options }}" ]] && export ASAN_OPTIONS="${{ matrix.config.asan_options }}" | ||
ctest --build-config Asan --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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Debug CI | ||
|
||
<!-- | ||
SPDX-License-Identifier: 2.0 license with LLVM exceptions | ||
--> | ||
|
||
## CI flows | ||
|
||
CI flows are found in [.github/workflows/](.github/workflows/). Usually, they are run when generating a Git Action (e.g. at `push`). | ||
|
||
WIP to add flows for tests, linting etc. | ||
|
||
## Run CI Flows on Local Setup | ||
|
||
We can use [nektos/act](https://github.com/nektos/act) to simulate and test Git Actions on local setup. | ||
Setup and tutorial on [nektosact.com/](https://nektosact.com/). | ||
|
||
```shell | ||
# Check available jobs | ||
$ sudo act --container-architecture linux/amd64 --list | ||
Stage Job ID Job name Workflow name Workflow file Events | ||
0 build ${{ matrix.config.name }} CI Tests ci.yml pull_request,push | ||
|
||
# Run all CI jobs | ||
Optional26 $ sudo act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:full-24.04 --container-architecture linux/amd64 push | ||
[CI Tests/Ubuntu Clang 18-2] π Start image=ghcr.io/catthehacker/ubuntu:full-24.04 | ||
[CI Tests/Ubuntu Clang 19-3] π Start image=ghcr.io/catthehacker/ubuntu:full-24.04 | ||
[CI Tests/Ubuntu Clang 17-1] π Start image=ghcr.io/catthehacker/ubuntu:full-24.04 | ||
[CI Tests/Ubuntu GCC 14-5 ] π Start image=ghcr.io/catthehacker/ubuntu:full-24.04 | ||
[CI Tests/Ubuntu GCC 13-4 ] π Start image=ghcr.io/catthehacker/ubuntu:full-24.04 | ||
... | ||
|
||
``` |
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