Skip to content

Commit

Permalink
CI: run cmake tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Dec 19, 2023
1 parent 512d67a commit 0aaec89
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 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
15 changes: 11 additions & 4 deletions .github/workflows/uwp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ jobs:
matrix:
config: [Debug, Release]
arch: [
{ "name": "x64", "option": "x64"},
{ "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: -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_CXX_FLAGS_INIT="-DWINVER=0x0A00 -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP"
CMAKE_OPTIONS: -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_CXX_FLAGS_INIT="-DWINVER=0x0A00 -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP" -DBUILD_TESTING=ON
# TODO use CreateFile2 and add -DENABLE_WIN32_IO=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 }} -A ${{ matrix.arch.option }} -DBUILD_SHARED_LIBS=OFF

Expand All @@ -34,3 +35,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
}
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 0aaec89

Please sign in to comment.