aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: f7ec68da17f4c899e6bf61c90281ea3d8178d55e (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
name: Run tests

on: [push, pull_request]

jobs:
  build:
    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 update
        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.strings.outputs.build-output-dir }}

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