Skip to content

Commit

Permalink
CI: run cmake tests on native builds
Browse files Browse the repository at this point in the history
UWP can't run ctest because it doesn't generate a .exe but a .msix.
  • Loading branch information
robUx4 committed Dec 19, 2023
1 parent d071a43 commit 0857db5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/linux-gcc13.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: libebml with gcc13
runs-on: ubuntu-latest
env:
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_TESTING=ON
steps:
- uses: lukka/get-cmake@latest

Expand All @@ -28,3 +28,6 @@ jobs:

- name: Test installation
run: cmake --install _build --prefix ${GITHUB_WORKSPACE}/_built

- name: Run tests
run: ctest --test-dir _build
7 changes: 5 additions & 2 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
name: libebml
runs-on: ubuntu-latest
env:
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_TESTING=ON
steps:
- uses: lukka/get-cmake@latest

- name: Get pushed code
uses: actions/checkout@v3

- name: Configure
run: cmake -S . -B _build ${{ env.CMAKE_OPTIONS }} -DCMAKE_INSTALL_PREFIX:STRING=${GITHUB_WORKSPACE}/_built

Expand All @@ -25,3 +25,6 @@ jobs:

- name: Test installation
run: cmake --install _build --prefix ${GITHUB_WORKSPACE}/_built

- name: Run tests
run: ctest --test-dir _build
10 changes: 8 additions & 2 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
matrix:
arch: [x86_64, arm64]
env:
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_TESTING=ON
steps:
- uses: lukka/get-cmake@latest

- name: Get pushed code
uses: actions/checkout@v3

- name: Configure
run: cmake -S . -B _build ${{ env.CMAKE_OPTIONS }} -DCMAKE_INSTALL_PREFIX:STRING=${GITHUB_WORKSPACE}/_built -DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"

Expand All @@ -29,3 +29,9 @@ jobs:

- name: Test installation
run: cmake --install _build --prefix ${GITHUB_WORKSPACE}/_built

- name: Run tests
run: |
if [ $(uname -m) = "${{ matrix.arch }}" ]; then
ctest --test-dir _build;
fi
16 changes: 11 additions & 5 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
{ "name": "Static", "option": "OFF"}
]
arch: [
{ "name": "x64", "option": "x64"},
{ "name": "x86", "option": "win32"},
{ "name": "arm64", "option": "arm64"},
{ "name": "x64", "option": "x64", "env": "AMD64"},
{ "name": "x86", "option": "win32", "env": "X86"},
{ "name": "arm64", "option": "arm64", "env": "ARM64"},
]
env:
CMAKE_OPTIONS: -DENABLE_WIN32_IO=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS_INIT="-DWINVER=0x0501"
CMAKE_OPTIONS: -DENABLE_WIN32_IO=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS_INIT="-DWINVER=0x0501" -DBUILD_TESTING=ON
steps:
- uses: lukka/get-cmake@latest

- name: Get pushed code
uses: actions/checkout@v3

- name: Configure ${{ matrix.shared.name }} library
run: cmake -S . -B _build ${{ env.CMAKE_OPTIONS }} -A ${{ matrix.arch.option }} -DBUILD_SHARED_LIBS=${{ matrix.shared.option }}

Expand All @@ -38,3 +38,9 @@ jobs:

- name: Test installation
run: cmake --install _build --config ${{ matrix.config }} --prefix ${GITHUB_WORKSPACE}/_built

- name: Run tests
run: |
if ($env:PROCESSOR_ARCHITECTURE -match "${{ matrix.arch.env }}") {
ctest --test-dir _build
}

0 comments on commit 0857db5

Please sign in to comment.