summaryrefslogtreecommitdiff
path: root/.github/workflows/cmake.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/cmake.yml')
-rw-r--r--.github/workflows/cmake.yml62
1 files changed, 62 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
new file mode 100644
index 0000000..ed3a79b
--- /dev/null
+++ b/.github/workflows/cmake.yml
@@ -0,0 +1,62 @@
+name: CMake
+on: [push, pull_request]
+jobs:
+ ci-cmake:
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - name: Ubuntu GCC
+ os: ubuntu-latest
+ compiler: gcc
+
+ - name: Ubuntu GCC ISB
+ os: ubuntu-latest
+ compiler: gcc
+ build-dir: "."
+ src-dir: "."
+
+ - name: Ubuntu Clang
+ os: ubuntu-latest
+ compiler: clang
+
+ - name: Ubuntu Clang Debug
+ os: ubuntu-latest
+ compiler: clang
+ build-config: Debug
+
+ - name: Windows MSVC Win32
+ os: windows-latest
+ compiler: cl
+ cmake-args: -A Win32
+
+ - name: Windows MSVC Win64
+ os: windows-latest
+ compiler: cl
+ cmake-args: -A x64
+
+ - name: macOS Clang
+ os: macos-latest
+ compiler: clang
+
+ - name: macOS GCC
+ os: macos-latest
+ compiler: gcc-9
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Generate project files
+ run: cmake -S ${{ matrix.src-dir || '../zlib' }} -B ${{ matrix.build-dir || '../build' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }}
+ env:
+ CC: ${{ matrix.compiler }}
+
+ - name: Compile source code
+ run: cmake --build ${{ matrix.build-dir || '../build' }} --config ${{ matrix.build-config || 'Release' }}
+
+ - name: Run test cases
+ run: ctest -C Release --output-on-failure --max-width 120
+ working-directory: ${{ matrix.build-dir || '../build' }}