summaryrefslogtreecommitdiff
path: root/lib/bindey/.github/workflows/ci.yml
blob: 060f14e441a2c7f343d78b9b6bbad9de5d95facc (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
name: ci

on: [pull_request]

env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: Release

jobs:
  Build-And-Test:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true

      - name: Create Build Environment
        # Some projects don't allow in-source building, so create a separate build directory
        # We'll use this as our working directory for all subsequent commands
        run: cmake -E make_directory ${{runner.workspace}}/build

      - name: Configure
        shell: bash
        working-directory: ${{runner.workspace}}/build
        run: cmake $GITHUB_WORKSPACE -GXcode -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBINDEY_BUILD_TESTS=ON
        env:
          CC: clang
          CXX: clang

      - name: Build
        working-directory: ${{runner.workspace}}/build
        shell: bash
        run: cmake --build . --config $BUILD_TYPE
        env:
          CC: clang
          CXX: clang

      - name: Test
        working-directory: ${{runner.workspace}}/build
        shell: bash
        # Execute tests defined by the CMake configuration.  
        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
        run: ctest -C $BUILD_TYPE