add virtualprotect for windows rawWriteMemory #355
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
name: Build TulipHook | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' # every branch | |
- '!no-build-**' # unless marked as no-build | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- name: 'Windows (32-bit)' | |
id: win-32 | |
arch: x86 | |
os: windows-latest | |
build_tests: true | |
extra_flags: '-DCMAKE_BUILD_TYPE=Debug' | |
out_paths: './build/src/TulipHook.lib' | |
- name: 'Windows (64-bit)' | |
id: win-64 | |
arch: x64 | |
os: windows-latest | |
build_tests: true | |
extra_flags: '-DCMAKE_BUILD_TYPE=Debug' | |
out_paths: './build/src/TulipHook.lib' | |
- name: 'macOS' | |
id: mac | |
os: macos-12 | |
build_tests: true | |
extra_flags: "-DCMAKE_BUILD_TYPE=Debug" | |
out_paths: './build/src/libTulipHook.a' | |
- name: 'macOS (m1)' | |
id: mac-arm | |
os: macos-14 | |
build_tests: true | |
extra_flags: "-DCMAKE_BUILD_TYPE=Debug" | |
out_paths: './build/src/libTulipHook.a' | |
- name: 'Android Armv7' | |
id: android-armv7 | |
os: ubuntu-latest | |
build_tests: false | |
extra_flags: "-DTULIP_DONT_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-25 -DANDROID_ARM_NEON=ON" | |
out_paths: './build/src/libTulipHook.a' | |
- name: 'Android Arm64' | |
id: android-arm64 | |
os: ubuntu-latest | |
build_tests: false | |
extra_flags: "-DTULIP_DONT_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-25 -DANDROID_ARM_NEON=ON" | |
out_paths: './build/src/libTulipHook.a' | |
name: Build and Test ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
env: | |
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache | |
CMAKE_C_COMPILER_LAUNCHER: sccache | |
CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1.12.1 | |
with: | |
arch: ${{ matrix.config.arch }} | |
if: matrix.config.id == 'win-32' || matrix.config.id == 'win-64' | |
# https://github.com/hendrikmuhs/ccache-action/pull/182 | |
- name: Setup sccache | |
uses: chirag-droid/ccache-action@main | |
with: | |
variant: sccache | |
key: ${{ matrix.config.id }}-v1 | |
- name: Install ninja-build tool | |
uses: seanmiddleditch/gha-setup-ninja@v3 | |
if: matrix.config.id != 'win-32' && matrix.config.id != 'win-64' | |
- name: Configure | |
shell: bash | |
run: cmake -G Ninja -B ./build ${{ matrix.config.extra_flags }} | |
- name: Build | |
shell: bash | |
run: | | |
cmake --build ./build --parallel | |
mkdir ./out | |
cp ${{ matrix.config.out_paths }} ./out | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: output-${{ matrix.config.id }} | |
path: ${{ github.workspace }}/out | |
- name: Test | |
run: ctest --test-dir ./build/test --output-on-failure | |
if: matrix.config.build_tests == true |