diff options
author | Ralph Giles <giles@thaumas.net> | 2021-07-08 07:10:04 -0700 |
---|---|---|
committer | Ralph Giles <giles@thaumas.net> | 2021-07-09 22:23:51 -0700 |
commit | 1708663af915d38508cf2baeb24157c327d278d5 (patch) | |
tree | 07c484b8f5a1b7fb78ab3fe2b351c51a2987bc9d | |
parent | b674b567403d331aa22a87e66444cdad8ae18aa4 (diff) | |
download | ogg-git-1708663af915d38508cf2baeb24157c327d278d5.tar.gz |
github actions: Add a basic CMake build.
Run cmake build and test steps on the three supported desktop
targets. Default compiler and so on is fine.
Although we define an environment variable to hold the path
to the cmake build directory, we must use the noisier expression
syntax of the github job builder to substitute into each
command line for portability across both unix and windows
shell syntax.
The windows image also requires an explicit build config
switch, `-C Debug` or similar, for ctest to execute even
though CMakeLists.txt doesn't define alternate build
configurations. On linux and macos ctest runs fine without
the extra argument.
-rw-r--r-- | .github/workflows/cmake.yml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..d9fa86c --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,38 @@ +name: CMake + +on: + push: + pull_request: + schedule: + - cron: '0 0 1 * *' + +jobs: + build: + strategy: + matrix: + os: + [ + ubuntu-latest, + macos-latest, + windows-latest, + ] + + runs-on: ${{ matrix.os }} + + env: + BUILD: _build + + steps: + - uses: actions/checkout@v2 + + - name: Prepare build directory + run: mkdir ${{ env.BUILD }} + + - name: Generate + run: cmake -S . -B ${{ env.BUILD }} + + - name: Build + run: cmake --build ${{ env.BUILD }} + + - name: Test + run: ctest --test-dir ${{ env.BUILD }} -V -C Debug |