Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @nevergiveupcpp
116 changes: 116 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
unittests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'pull_request'

strategy:
fail-fast: false

matrix:
include:
- name: Windows x64 / MSVC
os: windows-latest
preset: msvc-x64
vcpkg_triplet: x64-windows

- name: Windows x64 / Clang
os: windows-latest
preset: llvm-x64
vcpkg_triplet: x64-windows

- name: Windows ARM64 / MSVC
os: windows-11-arm
preset: msvc-arm64
vcpkg_triplet: arm64-windows

- name: Linux x64 / GCC
os: ubuntu-latest
preset: gcc-linux-x64
vcpkg_triplet: x64-linux-dynamic

- name: Linux ARM64 / GCC
os: ubuntu-24.04-arm
preset: gcc-linux-arm64
vcpkg_triplet: arm64-linux

- name: macOS ARM64 / AppleClang
os: macos-latest
preset: apple-clang-macos-arm64
vcpkg_triplet: arm64-osx

steps:
- uses: actions/checkout@v4

- name: Set VCPKG_ROOT
shell: bash
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV

- name: Install GTest
run: vcpkg install gtest:${{ matrix.vcpkg_triplet }}

- name: Configure
working-directory: tests/unittest
run: cmake --preset ${{ matrix.preset }}

- name: Build
working-directory: tests/unittest
run: cmake --build --preset ${{ matrix.preset }} --config Release

- name: Test
working-directory: tests/unittest/build/${{ matrix.preset }}
run: ctest --build-config Release --output-on-failure

benchmark:
name: Benchmark
runs-on: windows-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- name: Set VCPKG_ROOT
shell: bash
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV

- name: Install Google Benchmark
run: vcpkg install benchmark:x64-windows

- name: Configure
working-directory: tests/benchmark
run: cmake --preset msvc-x64

- name: Build
working-directory: tests/benchmark
run: cmake --build --preset msvc-x64 --config Release

- name: Run
working-directory: tests/benchmark/build/msvc-x64/Release
run: ./benchmark-pvm.exe --benchmark_format=json --benchmark_out=result.json

- name: Store results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: googlecpp
output-file-path: tests/benchmark/build/msvc-x64/Release/result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
comment-on-alert: true
alert-threshold: '150%'
fail-on-alert: true

all-checks:
name: All Checks
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [unittests]
steps:
- run: echo "All checks passed"
76 changes: 55 additions & 21 deletions tests/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
"VCPKG_TARGET_TRIPLET": "x86-windows"
}
},
{
"name": "msvc-arm64",
"inherits": "base-release",
"displayName": "MSVC ARM64 Release",
"binaryDir": "${sourceDir}/build/msvc-arm64",
"toolset": "v143",
"architecture": "ARM64",
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"VCPKG_TARGET_TRIPLET": "arm64-windows"
}
},
{
"name": "llvm-x64",
"inherits": "base-release",
Expand Down Expand Up @@ -84,32 +96,54 @@
"CMAKE_CXX_FLAGS": "-m32 -msse -msse2",
"VCPKG_TARGET_TRIPLET": "x86-linux"
}
}
],
"buildPresets": [
{
"name": "msvc-x64",
"configurePreset": "msvc-x64"
},
{
"name": "msvc-x86",
"configurePreset": "msvc-x86"
},
{
"name": "llvm-x64",
"configurePreset": "llvm-x64"
},
{
"name": "gcc-mingw-x64",
"configurePreset": "gcc-mingw-x64"
"name": "clang-linux-x64",
"inherits": "base-release",
"displayName": "Clang Linux x64 Release",
"binaryDir": "${sourceDir}/build/clang-linux-x64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"VCPKG_TARGET_TRIPLET": "x64-linux-dynamic"
}
},
{
"name": "gcc-linux-x64",
"configurePreset": "gcc-linux-x64"
"name": "gcc-linux-arm64",
"inherits": "base-release",
"displayName": "GCC Linux ARM64 Release",
"binaryDir": "${sourceDir}/build/gcc-linux-arm64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"VCPKG_TARGET_TRIPLET": "arm64-linux"
}
},
{
"name": "gcc-linux-x86",
"configurePreset": "gcc-linux-x86"
"name": "apple-clang-macos-arm64",
"inherits": "base-release",
"displayName": "Apple Clang macOS ARM64 Release",
"binaryDir": "${sourceDir}/build/apple-clang-macos-arm64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"VCPKG_TARGET_TRIPLET": "arm64-osx"
}
}
],
"buildPresets": [
{ "name": "msvc-x64", "configurePreset": "msvc-x64" },
{ "name": "msvc-x86", "configurePreset": "msvc-x86" },
{ "name": "msvc-arm64", "configurePreset": "msvc-arm64" },
{ "name": "llvm-x64", "configurePreset": "llvm-x64" },
{ "name": "gcc-mingw-x64", "configurePreset": "gcc-mingw-x64" },
{ "name": "gcc-linux-x64", "configurePreset": "gcc-linux-x64" },
{ "name": "gcc-linux-x86", "configurePreset": "gcc-linux-x86" },
{ "name": "clang-linux-x64", "configurePreset": "clang-linux-x64" },
{ "name": "gcc-linux-arm64", "configurePreset": "gcc-linux-arm64" },
{ "name": "apple-clang-macos-arm64", "configurePreset": "apple-clang-macos-arm64" }
]
}
}
4 changes: 2 additions & 2 deletions tests/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ target_link_libraries(benchmark-obfuscxx PRIVATE

target_compile_options(benchmark-obfuscxx PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/constexpr:steps10000000>
$<$<CXX_COMPILER_ID:GNU>:-mavx2>
$<$<CXX_COMPILER_ID:Clang>:-mavx2>
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<STREQUAL:${CMAKE_SYSTEM_PROCESSOR},aarch64>>>:-mavx2>
$<$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<STREQUAL:${CMAKE_SYSTEM_PROCESSOR},aarch64>>>:-mavx2>
)

target_compile_definitions(benchmark-obfuscxx PRIVATE
Expand Down
4 changes: 2 additions & 2 deletions tests/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ target_link_libraries(unittest-obfuscxx PRIVATE

target_compile_options(unittest-obfuscxx PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/constexpr:steps10000000>
$<$<CXX_COMPILER_ID:GNU>:-mavx2>
$<$<CXX_COMPILER_ID:Clang>:-mavx2>
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<STREQUAL:${CMAKE_SYSTEM_PROCESSOR},aarch64>>>:-mavx2>
$<$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<STREQUAL:${CMAKE_SYSTEM_PROCESSOR},aarch64>>>:-mavx2>
)

target_compile_definitions(unittest-obfuscxx PRIVATE
Expand Down
Loading