aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: b2d595915e87981bbd37a193310cd2a1394699ef (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
30
31
32
33
34
35
name: Run tests

on: [push, pull_request]

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

    - 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

    - name: Bats tests
      run: ./tests/vendor/bats-core/bin/bats tests/