Windows & Ubuntu & Apple macOS #13
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: Windows & Linux & macOS | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Linux ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: amd64 | |
flags: -m64 | |
- target: x86 | |
flags: -m32 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update -q -y | |
sudo apt-get install -y gcc-multilib g++-multilib valgrind libc6-dbg libc6-dbg:i386 | |
- name: Configure & build | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_C_FLAGS=${{ matrix.flags }} .. | |
cmake --build . | |
- name: Run tests | |
run: | | |
cd build | |
./test-defer | |
./test-exceptions | |
./test-cthread | |
./test-arena | |
./test-thrd_tls | |
./test-tls | |
build-windows: | |
name: Windows (${{ matrix.arch }}) | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x64, Win32] | |
steps: | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- uses: actions/checkout@v4 | |
- name: Configure & build | |
run: | | |
mkdir build | |
cd build | |
cmake .. -D BUILD_TESTING=ON -A ${{ matrix.arch }} | |
cmake --build . --config Debug | |
- name: Run tests | |
shell: cmd | |
run: | | |
cd build\Debug | |
.\test-defer.exe | |
.\test-exceptions.exe | |
.\test-cthread.exe | |
.\test-arena.exe | |
.\test-thrd_tls.exe | |
.\test-tls.exe | |
build-macos: | |
name: macOS | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure & build | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON .. | |
cmake --build . | |
- name: Run tests | |
run: | | |
cd build | |
./test-defer | |
./test-exceptions | |
./test-cthread | |
./test-arena | |
./test-thrd_tls | |
./test-tls |