Testing more generic workflow.

This commit is contained in:
Steffen Schuemann 2021-07-03 18:34:47 +02:00
parent ead40cc153
commit fde42cd4a5

View File

@ -3,58 +3,77 @@ name: CMake Build Matrix
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build-ubuntu-20: build:
runs-on: ubuntu-latest name: ${{ matrix.config.name }}
steps: runs-on: ${{ matrix.config.os }}
- uses: actions/checkout@v1 strategy:
with: fail-fast: false
submodules: true matrix:
- name: install config:
run: sudo apt-get -y install xorg-dev libglu1-mesa-dev libncursesw5-dev
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_TESTS=ON -DCMAKE_CXX_COMPILER="g++-9" -DCMAKE_C_COMPILER="gcc-9" ..
- name: build
run: cmake --build build
- name: test
run: cd build && ctest
build-ubuntu-18: - name: "Ubuntu latest GCC 9.3",
runs-on: ubuntu-18.04 os: ubuntu-20.04
steps: build_type: Release
- uses: actions/checkout@v1 packages: ninja-build
with: generator: Ninja
submodules: true cc: gcc
- name: install cxx: g++
run: sudo apt-get -y install gcc-8 g++-8 xorg-dev libglu1-mesa-dev libncursesw5-dev
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_TESTS=ON -DCMAKE_CXX_COMPILER="g++-8" -DCMAKE_C_COMPILER="gcc-8" ..
- name: build
run: cmake --build build
- name: test
run: cd build && ctest
build-macos: - name: "Ubuntu 18.04 GCC 8.4"
runs-on: macOS-latest os: ubuntu-18.04
steps: build_type: Release
- uses: actions/checkout@v1 packages: ninja-build gcc-8 g++-8
with: generator: Ninja
submodules: true cc: gcc-8
- name: configure cxx: g++-8
run: mkdir build && cd build && cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_TESTS=ON ..
- name: build - name: "Windows MSVC 2019"
run: cmake --build build os: windows-latest
- name: test build_type: Release
run: cd build && ctest packages: ninja
generator: "Visual Studio 16 2019"
- name: "macOS 10.15 AppleClang"
os: windows-latest
build_type: Release
packages: ninja
generator: Ninja
build-windows:
runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with:
submodules: true - name: print environment
- name: configure run: |
run: mkdir build && cd build && cmake .. echo github.event.action: ${{ github.event.action }}
- name: build echo github.event_name: ${{ github.event_name }}
run: cmake --build build --config Release
- name: test - name: Install dependencies on Ubuntu
run: cd build && ctest -C Release if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt install ${{ matrix.config.packages }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ${{ matrix.config.packages }}
- name: Install dependencies on macOS
if: startsWith(matrix.config.os, 'macos')
run: |
brew install ${{ matrix.config.packages }}
- name: Configure project
shell: bash
run: |
ninja --version
cmake --version
mkdir build
mkdir install
cmake -G "${{ matrix.config.generator }}" -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX:PATH=install
- name: Build project
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }}
- name: Run tests
run: cd build && ctest