From e609b41ee8e2591a09a64aa96f22c4380a614d66 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 30 Sep 2024 23:09:21 -0400 Subject: [PATCH] ci: add unit tests --- .github/workflows/c_unit_tests.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/c_unit_tests.yaml diff --git a/.github/workflows/c_unit_tests.yaml b/.github/workflows/c_unit_tests.yaml new file mode 100644 index 000000000..d16d3bf89 --- /dev/null +++ b/.github/workflows/c_unit_tests.yaml @@ -0,0 +1,24 @@ +name: C Unit Tests + +on: + workflow_dispatch: + push: + branches: [trunk] + pull_request: + branches: [trunk] + +permissions: # added using https://github.com/step-security/secure-repo + contents: read + +jobs: + unit-tests: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + + - name: atsdk Unit CTest + working-directory: packages/c + run: | + cmake -S . -B build -DSSHNPD_BUILD_TESTS=ON + cmake --build build + ctest --test-dir build/sshnpd/tests --output-on-failure --timeout 2