Update release workflow to cut PR instead of pushing. #263
This file contains hidden or 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: Repository Pull Request Checks | ||
| on: | ||
| 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: | ||
| PR-repo-checks: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.pull_request }} || ${{ github.event.workflow }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| inputs: | ||
| [ | ||
| { | ||
| repository: FreeRTOS-Kernel, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: false, | ||
| run-doxygen: false, | ||
| exclude-urls: 'https://www.microchip.com, https://www.microchip.com/support', | ||
| }, | ||
| { | ||
| repository: FreeRTOS-Plus-TCP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: false, | ||
| run-doxygen: false, | ||
| exclude-dirs: 'source/portable/NetworkInterface/STM32' | ||
| exclude-urls: 'https://www.microchip.com/en-us/support/design-help, http://www.atmel.com/design-support' | ||
| }, | ||
| { | ||
| repository: FreeRTOS, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: false, | ||
| run-spelling-check: true, | ||
| run-complexity: false, | ||
| run-doxygen: false, | ||
| exclude-dirs: 'ethernet, drivers, FreeRTOS/Demo, WinPCap, libslirp-version.h, CMSIS, Trace_Recorder_Configuration, ThirdParty, conssole.h, syscalls.c, Demo_IP_Protocols, Reliance-Edge' | ||
| }, | ||
| { | ||
| repository: backoffAlgorithm, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-Wall -Wextra -Werror', | ||
| }, | ||
| { | ||
| repository: coreHTTP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-Wall -Wextra -DNDEBUG', | ||
| coverage-skips: "*3rdparty*", | ||
| }, | ||
| { | ||
| repository: coreJSON, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror', | ||
| }, | ||
| { | ||
| repository: coreMQTT, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG', | ||
| }, | ||
| { | ||
| repository: corePKCS11, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: false, | ||
| run-spelling-check: false, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DSYSTEM_TESTS=0 -DCMAKE_C_FLAGS='-Wall -Wextra -DNDEBUG', | ||
| branch-coverage: 90, | ||
| }, | ||
| { | ||
| repository: coreSNTP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG -Wno-error=pedantic -Wno-variadic-macros -DLOGGING_LEVEL_DEBUG=1', | ||
| }, | ||
| { | ||
| repository: FreeRTOS-Cellular-Interface, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG', | ||
| }, | ||
| { | ||
| repository: Device-Defender-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG', | ||
| }, | ||
| { | ||
| repository: Device-Shadow-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG', | ||
| }, | ||
| { | ||
| repository: Fleet-Provisioning-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG', | ||
| }, | ||
| { | ||
| repository: Jobs-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: false, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -Werror', | ||
| }, | ||
| { | ||
| repository: ota-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-link-verifier: true, | ||
| run-spelling-check: true, | ||
| run-complexity: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='-Wall -Wextra -DNDEBUG', | ||
| }, | ||
| { | ||
| repository: SigV4-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| run-complexity: true, | ||
| run-spelling-check: true, | ||
| run-doxygen: true, | ||
| build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='-Wall -Wextra -DNDEBUG -DLOGGING_LEVEL_DEBUG=1', | ||
| }, | ||
| ] | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: actions/[email protected] | ||
| - env: | ||
| stepName: Install Common Tools | ||
| shell: bash | ||
| run: | | ||
| # ${{ env.stepName }} | ||
| echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | ||
| sudo apt-get -y update | ||
| sudo apt-get install -y lcov sed build-essential cmake | ||
| echo -e "::endgroup::" | ||
| echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" | ||
| - name: "Clone: ${{ matrix.inputs.repository }}" | ||
| uses: actions/[email protected] | ||
| with: | ||
| repository: ${{ matrix.inputs.org }}/${{ matrix.inputs.repository }} | ||
| ref: ${{ matrix.inputs.branch }} | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| - name: "Link Verifier Check: ${{ matrix.inputs.repository }}" | ||
| uses: ./link-verifier | ||
| if: matrix.inputs.run-link-verifier && ( success() || failure() ) | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| exclude-dirs: complexity, formatting | ||
| exclude-urls: https://dummy-url.com/ota.bin, https://s3.region.amazonaws.com/joe-ota, https://www.gnu.org/software/complexity/manual/complexity.html, https://www.u-blox.com/en/product/sara-r4-series${{ matrix.inputs.exclude-urls && format(',{0}', matrix.inputs.exclude-urls) || '' }} | ||
| - name: "Complexity Check: ${{ matrix.inputs.repository }}" | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| uses: ./complexity | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| horrid_threshold: 16 | ||
| - name: "Doxygen Build Check ${{ matrix.inputs.repository }}" | ||
| if: matrix.inputs.run-doxgyen && ( success() || failure() ) | ||
| uses: ./doxygen | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| - name: "Doxygen Zip Check: ${{ matrix.inputs.repository }}" | ||
| if: success() || failure() | ||
| uses: ./doxygen | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| generate_zip: true | ||
| - name: "Spelling Check: ${{ matrix.inputs.repository }} " | ||
| if: matrix.inputs.run-spelling-check && ( success() || failure() ) | ||
| uses: ./spellings | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| exclude-dirs: ${{ matrix.inputs.exclude-dirs }} | ||
| - name: "Recursive Clone: ${{ matrix.inputs.repository }}" | ||
| if: success() || failure() | ||
| uses: actions/[email protected] | ||
| with: | ||
| repository: ${{ matrix.inputs.org }}/${{ matrix.inputs.repository }} | ||
| ref: ${{ matrix.inputs.branch }} | ||
| path: repo/${{ matrix.inputs.repository }}_Recursive | ||
| submodules: recursive | ||
| # Need full history to make sure we get submodules | ||
| fetch-depth: 0 | ||
| - name: Ensure Recursive Clone of ${{ matrix.inputs.repository }} | ||
| if: success() || failure() | ||
| shell: bash | ||
| working-directory: repo/${{ matrix.inputs.repository }}_Recursive | ||
| run: git submodule update --checkout --init --recursive | ||
| - env: | ||
| stepName: Build ${{matrix.inputs.repository}} | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| shell: bash | ||
| working-directory: repo/${{matrix.inputs.repository}}_Recursive | ||
| run: | | ||
| # ${{ env.stepName }} | ||
| echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | ||
| cmake -S ./test -B build/ ${{ matrix.inputs.build-flags }} -DUNITTEST=ON | ||
| make -C build/ all | ||
| echo -e "::endgroup::" | ||
| echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" | ||
| - name: Test | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| shell: bash | ||
| working-directory: repo/${{matrix.inputs.repository}}_Recursive | ||
| run: ctest --test-dir build -E system --output-on-failure | ||
| - name: "Manifest Verifier: ${{ matrix.inputs.repository }}" | ||
| if: success() || failure() | ||
| uses: ./manifest-verifier | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }}_Recursive | ||
| fail-on-incorrect-version: true | ||
| - name: "Memory Statistics Check: ${{ matrix.inputs.repository }}" | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| uses: ./memory_statistics | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }}_Recursive | ||
| config: .github/memory_statistics_config.json | ||
| output: size_table_new.html | ||
| check_against: docs/doxygen/include/size_table.md | ||
| - env: | ||
| stepName: Coverage ${{matrix.inputs.repository}} | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| shell: bash | ||
| working-directory: repo/${{matrix.inputs.repository}}_Recursive | ||
| run: | | ||
| # ${{ env.stepName }} | ||
| echo -e "::group::${{ env.bashInfo }} Build ${{matrix.inputs.repository}} ${{ env.bashEnd }}" | ||
| make -C build/ coverage | ||
| echo -e "::endgroup::" | ||
| echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" | ||
| if [[ "${{ matrix.inputs.coverage-skips }}" != "" ]]; then | ||
| declare -a EXCLUDE=( ${{ matrix.inputs.coverage-skips }} ) | ||
| echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info | ||
| else | ||
| lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info | ||
| fi | ||
| echo -e "::endgroup::" | ||
| lcov --rc lcov_branch_coverage=1 --summary build/coverage.info | ||
| - name: Test coverage cop action ${{matrix.inputs.repository}} | ||
| if: matrix.inputs.run-complexity && ( success() || failure() ) | ||
| uses: ./coverage-cop | ||
| with: | ||
| coverage-file: repo/${{matrix.inputs.repository}}_Recursive/build/coverage.info | ||
| branch-coverage-min: ${{ matrix.inputs.branch_coverage }} | ||
| PR-uncrustify-checks: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.pull_request }} || ${{ github.event.workflow }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| inputs: | ||
| [ | ||
| { | ||
| repository: FreeRTOS-Kernel, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| exclude-dirs: 'portable' | ||
| }, | ||
| { | ||
| repository: FreeRTOS-Plus-TCP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| exclude-dirs: 'source/portable/NetworkInterface/STM32' | ||
| }, | ||
| { | ||
| repository: FreeRTOS, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| exclude-dirs: 'ethernet, drivers, FreeRTOS/Demo, WinPCap, libslirp-version.h, CMSIS, Trace_Recorder_Configuration, ThirdParty, conssole.h, syscalls.c, Demo_IP_Protocols, Reliance-Edge' | ||
| }, | ||
| { | ||
| repository: FreeRTOS-Cellular-Interface, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: backoffAlgorithm, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: coreHTTP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: coreJSON, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: coreMQTT, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: corePKCS11, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: coreSNTP, | ||
| org: FreeRTOS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: Device-Defender-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: Device-Shadow-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: Fleet-Provisioning-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: Jobs-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: ota-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| { | ||
| repository: SigV4-for-AWS-IoT-embedded-sdk, | ||
| org: AWS, | ||
| branch: main, | ||
| }, | ||
| ] | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: actions/[email protected] | ||
| - name: "Clone: ${{ matrix.inputs.repository }}" | ||
| uses: actions/[email protected] | ||
| with: | ||
| repository: ${{ matrix.inputs.org }}/${{ matrix.inputs.repository }} | ||
| ref: ${{ matrix.inputs.branch }} | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| - name: "Formatting Check : ${{ matrix.inputs.repository }}" | ||
| if: success() || failure() | ||
| uses: ./formatting | ||
| with: | ||
| path: repo/${{ matrix.inputs.repository }} | ||
| exclude-files: ${{ matrix.inputs.exclude-files }} | ||
| exclude-dirs: ${{ matrix.inputs.exclude-dirs }} | ||