aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: 05ebee919382575d14c4967854940d8db72aae37 (plain) (blame)
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
name: Run tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v4

    - name: Set build output directory
      id: build-output-dir
      shell: bash
      run: |
        echo "path=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

    - name: Install dependencies
      run: sudo apt-get install -y libcmocka-dev
  
    - name: Configure CMake
      run: >
        cmake -B ${{ steps.build-output-dir.outputs.path }} -S ${{ github.workspace }}

    - name: Build
      run: cmake --build ${{ steps.build-output-dir.outputs.path }}

    - name: Test
      working-directory: ${{ steps.build-output-dir.outputs.path }}
      run: ctest --output-on-failure