Skip to content

Commit

Permalink
Update the ci.yml workflow to use echo groups with colour. Use consis…
Browse files Browse the repository at this point in the history
…tent spacing as well.
  • Loading branch information
Skptak committed Apr 3, 2024
1 parent 05f6eca commit 8999baf
Showing 1 changed file with 63 additions and 24 deletions.
87 changes: 63 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
bashPass: \033[32;1mPASSED -
bashWarn: \033[33;1mWARNING -
bashInfo: \033[33;1mWINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m

Expand All @@ -21,24 +21,32 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- env:
stepName: Build Unit Tests
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group::Install Dependencies"
git submodule update --checkout
cd tools/CMock
git submodule update --init vendor/unity
cd ../..
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
git submodule update --checkout --init --recursive
sudo apt-get update -y
sudo apt-get install -y lcov
sudo apt-get install -y unifdef
sudo apt-get install -y ninja-build
echo "::endgroup::"
echo "::group:: ${{ env.stepName }}"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
- env:
stepName: Build Unit Tests
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S test/unit-test -B test/unit-test/build/ -G Ninja
cmake --build test/unit-test/build/ --target all
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -48,8 +56,10 @@ jobs:
shell: bash
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
ctest --test-dir test/unit-test/build/ -E system --output-on-failure
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -59,8 +69,10 @@ jobs:
shell: bash
run: |
# ${{ env.stepName }}
echo "::group::Build Tests"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake --build test/unit-test/build/ --target coverage
echo "::endgroup::"
echo -e "${{ env.bashPass }} Built Coverage Tests ${{ env.bashEnd }}"
Expand Down Expand Up @@ -142,8 +154,11 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
sudo apt-get update -y
sudo apt-get install -y libpcap-dev
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -152,9 +167,11 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -163,10 +180,12 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -175,9 +194,11 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -186,10 +207,12 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_IPV6
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -198,10 +221,12 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_TCP
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -210,9 +235,11 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6_TCP
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -221,10 +248,12 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -233,10 +262,12 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DEFAULT_CONF
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand Down Expand Up @@ -264,7 +295,7 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
sudo apt-get install complexity
sudo apt-get install uncrustify
echo "::endgroup::"
Expand All @@ -275,7 +306,8 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
COMPLEXITY_PARAMS="--scores --threshold=10 --horrid-threshold=283"
TEMP_DIR=./temp
mkdir -p ${TEMP_DIR}
Expand All @@ -289,6 +321,7 @@ jobs:
find ${TEMP_DIR} -iname '*.c' | xargs complexity ${COMPLEXITY_PARAMS}
RESULT=$?
rm -rf ${TEMP_DIR}
echo "::endgroup::"
if [ "${RESULT}" = "0" ]; then
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand Down Expand Up @@ -316,8 +349,10 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cd git-secrets && sudo make install && cd ..
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -326,9 +361,11 @@ jobs:
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
git-secrets --register-aws
git-secrets --scan
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand All @@ -347,10 +384,12 @@ jobs:
shell: bash
run: |
# ${{ env.stepName }}
echo "::group:: ${{ env.stepName }}"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
git submodule update --init --checkout --recursive
sudo apt-get update
sudo apt-get install --yes --no-install-recommends gcc-multilib
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
Expand Down

0 comments on commit 8999baf

Please sign in to comment.