zlib/.github/workflows/cmake.yml
Mark Adler 67eb09a20b Add continuous integration workflows. [nmoinvaz]
These workflows will be run to verify that project generation,
source file compilation, and test cases run successfully.
2022-10-06 21:59:53 -07:00

63 lines
1.7 KiB
YAML

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' }}