Merge pull request #395 from pennam/esp_partition #871
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/testArduinoIoTCloud | |
coverage-exclude-paths: | | |
- '*/extras/test/*' | |
- '/usr/*' | |
- '*/src/cbor/lib/*' | |
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }} | |
# A token is used to avoid intermittent spurious job failures caused by rate limiting. | |
- name: Set up Codecov upload token | |
run: | | |
if [[ "${{ github.repository }}" == "arduino-libraries/ArduinoIoTCloud" ]]; then | |
# In order to avoid uploads of data from forks, only use the token for runs in the parent repo. | |
# Token is intentionally exposed. | |
# See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 | |
CODECOV_TOKEN="47827969-3fda-4ba1-9506-e8d0834ed88c" | |
else | |
# codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input. | |
CODECOV_TOKEN="" | |
fi | |
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV" | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: "${{ env.COVERAGE_DATA_PATH }}" | |
fail_ci_if_error: true | |
token: ${{ env.CODECOV_TOKEN }} |