Correct SPDX ID #6
Workflow file for this run
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: Test Actions | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: [main,v2] | |
workflow_dispatch: | |
env: | |
# The bash escape character is \033 | |
bashPass: \033[32;1mPASSED - | |
bashInfo: \033[33;1mINFO - | |
bashFail: \033[31;1mFAILED - | |
bashEnd: \033[0m | |
jobs: | |
test-format-check: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
path: coreMQTT | |
- name: Test formatting check action | |
uses: ./formatting | |
with: | |
path: coreMQTT | |
exclude-dirs: build,docs | |
test-complexity-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
ref: main | |
path: coreMQTT | |
- name: Test complexity check action | |
uses: ./complexity | |
with: | |
path: coreMQTT | |
# The default threshold for all repos is 10 | |
horrid_threshold: 10 | |
test-doxygen-zip-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: aws/aws-iot-device-sdk-embedded-C | |
submodules: recursive | |
ref: main | |
path: aws-iot-device-sdk-embedded-C | |
- name: Test doxygen build action | |
uses: ./doxygen | |
with: | |
path: ./aws-iot-device-sdk-embedded-C | |
libs_parent_dir_path: libraries/standard,libraries/aws | |
generate_zip: true | |
test-doxygen-non-zip-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
ref: main | |
path: coreMQTT | |
- name: Test doxygen build action | |
uses: ./doxygen | |
with: | |
path: coreMQTT | |
test-spell-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
ref: main | |
path: coreMQTT | |
- name: Test spell check action | |
uses: ./spellings | |
with: | |
path: coreMQTT | |
test-spell-checker-find-mistake: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
ref: main | |
path: coreMQTT | |
- name: Empty the lexicon | |
shell: bash | |
working-directory: coreMQTT | |
run: file=$(find . -name .cSpellWords.txt); readlink -f "$file" ; > "$file" | |
- name: Test Spell Check Fails on Misspelled Word | |
continue-on-error: true | |
id: test-spellings-find-mistake | |
uses: ./spellings | |
with: | |
path: coreMQTT | |
- env: | |
stepName: Check Failure Test Case | |
name: ${{ env.stepName }} | |
id: check-failure-test-cases | |
shell: bash | |
run: | | |
# ${{ env.stepName }} | |
exitStatus=0 | |
if [ "${{ steps.test-spellings-find-mistake.outcome}}" = "failure" ]; then | |
echo -e "${{ env.bashPass }} Functional | Failure | Fail on Misspelled Word | Had Expected "failure" ${{ env.bashEnd }}" | |
else | |
echo -e "${{ env.bashFail }} Functional | Failure | Fail on Misspelled Word | Had Unexpected "success" ${{ env.bashEnd }}" | |
exitStatus=1 | |
fi | |
exit $exitStatus | |
test-coverage-cop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/coreMQTT | |
ref: main | |
path: coreMQTT | |
- env: | |
stepName: Build Core MQTT | |
name: ${{ env.stepName }} | |
run: | | |
# ${{ env.stepName }} | |
exitStatus=0 | |
echo -e "::group::Install Lcov" | |
sudo apt-get install -y lcov | |
echo -e "::endgroup::" | |
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | |
cmake -S ./coreMQTT/test -B build/ \ | |
-G "Unix Makefiles" \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DBUILD_CLONE_SUBMODULES=ON \ | |
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG' | |
make -C build/ all | |
exitStatus=$? | |
echo -e "::endgroup::" | |
# Only get to here if we passed the build | |
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" | |
- name: Run CTest for CoreMQTT | |
run: ctest --test-dir build -E system --output-on-failure | |
- env: | |
stepName: Passing Coverage Test | |
shell: bash | |
run: | | |
# ${{ env.stepName }} | |
echo -e "::group::Build Coverage for coreMQTT" | |
make -C build/ coverage | |
echo -e "::endgroup::" | |
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | |
declare -a EXCLUDE=("\*test/\*" "\*CMakeCCompilerId\*" "\*mocks\*") | |
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 --remove build/coverage.info -o build/coverage.info | |
echo -e "::endgroup::" | |
lcov --rc lcov_branch_coverage=1 --list build/coverage.info | |
echo -e "${{ env.bashPass }} ${{env.stepName }} ${{ env.bashEnd }}" | |
- name: Test Coverage Cop Action | |
id: success-coverage-cop | |
uses: ./coverage-cop | |
with: | |
coverage-file: ./build/coverage.info | |
branch-coverage-min: 70 | |
line-coverage-min: 100 | |
- env: | |
stepName: Create Lower Branch and Line Coverage Report | |
id: failure-coverage-action | |
continue-on-error: true | |
shell: bash | |
run: | | |
# ${{ env.stepName }} | |
echo -e "::group::Build Coverage for coreMQTT" | |
make -C build/ clean | |
make -C build/ coverage | |
echo -e "::endgroup::" | |
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | |
declare -a EXCLUDE=("\*test/\*") | |
set +e | |
lcov --rc lcov_branch_coverage=1 --remove build/coverage.info -o build/coverage.info | |
echo -e "::endgroup::" | |
lcov --rc lcov_branch_coverage=1 --list build/coverage.info | |
set -e | |
echo -e "${{ env.bashPass }} ${{env.stepName }} ${{ env.bashEnd }}" | |
- name: Functional | Failure | Coverage Cop Failure Test Case | |
id: failure-coverage-cop-action | |
continue-on-error: true | |
uses: ./coverage-cop | |
with: | |
coverage-file: ./build/coverage.info | |
branch-coverage-min: 100 | |
line-coverage-min: 100 | |
- env: | |
stepName: Check Failure Test Case | |
name: ${{ env.stepName }} | |
if: success() || failure() | |
id: check-failure-test-cases | |
shell: bash | |
run: | | |
# ${{ env.stepName }} | |
exitStatus=0 | |
if [ "${{ steps.failure-coverage-cop-action.outcome }}" = "failure" ]; then | |
echo -e "${{ env.bashPass }} Functional | Failure | Coverage Cop Failure Test Case | Had Expected "failure" ${{ env.bashEnd }}" | |
else | |
echo -e "${{ env.bashFail }} Functional | Failure | Coverage Cop Failure Test Case | Had Unexpected "success" ${{ env.bashEnd }}" | |
exitStatus=1 | |
fi | |
exit $exitStatus | |
test-memory-statistics: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test memory statistics action | |
uses: ./memory_statistics | |
with: | |
path: memory_statistics/test | |
config: ./memory_statistics_config.json | |
output: ./size_table_new.html | |
check_against: ./size_table_expected.html | |
test-link-verifier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python environment | |
uses: actions/setup-python@v3 | |
- env: | |
stepName: "Functional | Success | Link Verifier Works & Excludes Directory" | |
name: ${{ env.stepName }} | |
id: link-verifier-success-case | |
uses: ./link-verifier | |
with: | |
path: ./ | |
exclude-dirs: complexity, formatting, badFiles | |
allowlist-file: link-verifier/badUrls.md | |
- env: | |
stepName: "Functional | Success | Links being Excluded" | |
name: ${{ env.stepName }} | |
id: link-verifier-exclude-url-success-case | |
uses: ./link-verifier | |
with: | |
path: ./ | |
exclude-dirs: complexity, formatting | |
exclude-urls: https://dummy-url.com/ota.bin, https://dummy-url.com/ota.com, https://dummy-url-three.com/ota.bin, https://github.com/FreeRTOS/A-Repo-That-Wins-You-The-Lottery | |
- env: | |
stepName: "Functional | Failure | Link Does Not Exist" | |
name: ${{ env.stepName }} | |
id: link-verifier-fail-case | |
continue-on-error: true | |
uses: ./link-verifier | |
with: | |
path: ./ | |
exclude-dirs: complexity, formatting | |
allowlist-file: badUrls.md | |
- env: | |
stepName: Check Failure Test Case | |
name: ${{ env.stepName }} | |
id: check-failure-test-cases | |
shell: bash | |
run: | | |
# ${{ env.stepName }} | |
exitStatus=0 | |
if [ "${{ steps.link-verifier-fail-case.outcome}}" = "failure" ]; then | |
echo -e "${{ env.bashPass }} Functional | Failure | Link Does Not Exist | Had Expected "failure" ${{ env.bashEnd }}" | |
else | |
echo -e "${{ env.bashFail }} Functional | Failure | Link Does Not Exist | Had Unexpected "success" ${{ env.bashEnd }}" | |
exitStatus=1 | |
fi | |
exit $exitStatus | |
test-manifest-verifier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python environment | |
uses: actions/setup-python@v3 | |
- name: Checkout the FreeRTOS/FreeRTOS repository for testing action on. | |
uses: actions/checkout@v3 | |
with: | |
repository: FreeRTOS/FreeRTOS | |
ref: '202107.00' | |
path: FreeRTOS | |
submodules: recursive | |
- name: Test manifest verifier | |
uses: ./manifest-verifier | |
with: | |
path: ./FreeRTOS | |
exclude-submodules: FreeRTOS-Plus/Test/CMock,FreeRTOS/Test/CMock/CMock,FreeRTOS/Test/litani | |
fail-on-incorrect-version: true | |