2022-10-07 00:50:16 -04:00
|
|
|
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
|
|
|
|
|
2022-10-10 21:38:33 -04:00
|
|
|
# Test out of source builds
|
|
|
|
- name: Ubuntu GCC OSB
|
2022-10-07 00:50:16 -04:00
|
|
|
os: ubuntu-latest
|
|
|
|
compiler: gcc
|
2022-10-10 21:38:33 -04:00
|
|
|
build-dir: ../build
|
|
|
|
src-dir: ../zlib
|
2022-10-07 00:50:16 -04:00
|
|
|
|
2022-10-10 21:06:52 -04:00
|
|
|
- name: Ubuntu GCC -O3
|
|
|
|
os: ubuntu-latest
|
|
|
|
compiler: gcc
|
|
|
|
cflags: -O3
|
|
|
|
|
2022-10-07 00:50:16 -04:00
|
|
|
- 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
|
2022-10-10 21:38:33 -04:00
|
|
|
run: cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }}
|
2022-10-07 00:50:16 -04:00
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
2022-10-10 21:06:52 -04:00
|
|
|
CFLAGS: ${{ matrix.cflags }}
|
2022-10-07 00:50:16 -04:00
|
|
|
|
|
|
|
- name: Compile source code
|
2022-10-10 21:38:33 -04:00
|
|
|
run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }}
|
2022-10-07 00:50:16 -04:00
|
|
|
|
|
|
|
- name: Run test cases
|
|
|
|
run: ctest -C Release --output-on-failure --max-width 120
|
2022-10-10 21:38:33 -04:00
|
|
|
working-directory: ${{ matrix.build-dir || '.' }}
|
2022-10-10 21:39:14 -04:00
|
|
|
|
|
|
|
- name: Upload build errors
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.name }} (cmake)
|
|
|
|
path: |
|
|
|
|
**/CMakeFiles/CMakeOutput.log
|
|
|
|
**/CMakeFiles/CMakeError.log
|
|
|
|
retention-days: 7
|