aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: e826167e8040e4e1335e5b15ed46a07fd1df000c (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
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.build-output-dir.outputs.path }}

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