summaryrefslogtreecommitdiff
path: root/.github/workflows/build_and_test.yml
blob: c14b6c249b1ed2d2535784344f71ca9eb96c1c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build and test

on:
  push:
    branches: [ dev, stable ]
  pull_request:
    branches: [ dev, stable ]
  schedule:
    - cron: '0 0 */16 * *'
  workflow_dispatch:

env:
  BUILD_TYPE: Debug

jobs:
  build:
    strategy:
      matrix:
        os: [ ubuntu-latest, macos-latest, windows-2019 ]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v3

      - name: Build
        shell: bash
        run: |
          cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE -B build -S .
          cmake --build build --config $BUILD_TYPE

      - name: Run tests
        shell: bash
        working-directory: ${{ github.workspace }}/build
        run: |
          ctest -V -C $BUILD_TYPE

  integration:
    strategy:
      matrix:
        os: [ ubuntu-latest, macos-latest, windows-2019 ]
        name: [ fetch_content, find_package ]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v3

      - name: Build
        shell: bash
        working-directory: ./source/test/integration/${{ matrix.name }}
        run: |
          cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE -B build -S .
          cmake --build build --config $BUILD_TYPE

      - name: Run tests
        shell: bash
        working-directory: ./source/test/integration/${{ matrix.name }}/build
        run: |
          ctest -V -C $BUILD_TYPE