Skip to content

Instantly share code, notes, and snippets.

@ethomson
Created December 15, 2019 00:39
Show Gist options
  • Save ethomson/79c787cecee5c23f2c791500d6644583 to your computer and use it in GitHub Desktop.
Save ethomson/79c787cecee5c23f2c791500d6644583 to your computer and use it in GitHub Desktop.
name: Build with CMake and Ninja
on: [push]
jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- name: Install Dependencies (Linux)
run: sudo apt-get install ninja-build
if: matrix.os == 'ubuntu-latest'
- name: Install Dependencies (Windows)
run: choco install ninja
if: matrix.os == 'windows-latest'
- name: Install Dependencies (macOS)
run: brew install ninja
if: matrix.os == 'macos-latest'
- name: Get Sources
uses: actions/checkout@v1
- name: Setup CMake
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake $GITHUB_WORKSPACE -GNinja
shell: bash
- name: Build
run: cmake --build .
working-directory: ${{ runner.workspace }}/build
- name: Test
run: ctest -V
working-directory: ${{ runner.workspace }}/build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment