From 6080fde0d34c06e39cf9b332505b37406e48e20b Mon Sep 17 00:00:00 2001 From: Paolo Calao Date: Mon, 2 Nov 2020 16:59:23 +0100 Subject: [PATCH] [WIP] Add unit test workflow based on https://github.com/arduino/cpp-test-action/pull/2 --- .github/workflows/unit-tests.yml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..b889c771 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,45 @@ +name: Unit Tests + +on: + pull_request: + paths: + - ".github/workflows/unit-tests.yml" + - 'extras/test/**' + - 'src/**' + + push: + paths: + - ".github/workflows/unit-tests.yml" + - 'extras/test/**' + - 'src/**' + +jobs: + test: + name: Run unit tests + runs-on: ubuntu-latest + + env: + COVERAGE_DATA_PATH: extras/coverage-data/coverage.info + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: arduino/cpp-test-action@main + with: + runtime-paths: | + - extras/test/build/bin/TEST_TARGET_UUID + - extras/test/build/bin/TEST_TARGET_DISC_DEVICE + - extras/test/build/bin/TEST_TARGET_ADVERTISING_DATA + coverage-exclude-paths: | + - '*/extras/test/*' + - '/usr/*' + coverage-data-path: ${{ env.COVERAGE_DATA_PATH }} + + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v1 + with: + file: "${{ env.COVERAGE_DATA_PATH }}" + fail_ci_if_error: true + +