From 48b4fb01acde53d6f46913413310f8cf961bf526 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:23:32 -0300 Subject: [PATCH] ci(debug): Compile once a week with verbose log level --- .github/scripts/on-push.sh | 7 ++++--- .github/workflows/push.yml | 30 ++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/scripts/on-push.sh b/.github/scripts/on-push.sh index aafc9de0596..46ebe9232b1 100755 --- a/.github/scripts/on-push.sh +++ b/.github/scripts/on-push.sh @@ -9,8 +9,9 @@ function build { local chunk_index=$2 local chunks_cnt=$3 local build_log=$4 - local sketches_file=$5 - shift 5 + local log_level=$5 + local sketches_file=$6 + shift 6 local sketches=("$@") local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build" @@ -19,7 +20,7 @@ function build { local args=("-ai" "$ARDUINO_IDE_PATH" "-au" "$ARDUINO_USR_PATH" "-t" "$target") if [ "$OS_IS_LINUX" == "1" ]; then - args+=("-p" "$ARDUINO_ESP32_PATH/libraries" "-i" "$chunk_index" "-m" "$chunks_cnt") + args+=("-p" "$ARDUINO_ESP32_PATH/libraries" "-i" "$chunk_index" "-m" "$chunks_cnt" "-d" "$log_level") if [ -n "$sketches_file" ]; then args+=("-f" "$sketches_file") fi diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e6f497998b0..2ca9e52e48d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,6 +2,22 @@ name: Compilation Tests on: workflow_dispatch: + inputs: + log_level: + description: "Log level" + default: "none" + type: "choice" + required: true + options: + - "none" + - "error" + - "warn" + - "info" + - "debug" + - "verbose" + schedule: + # Every Sunday at 2:00 UTC run a build with verbose log level + - cron: "0 2 * * SUN" push: branches: - master @@ -163,9 +179,19 @@ jobs: ./tools/riscv32-* ./tools/xtensa-* + - name: Set Log Level + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + echo "LOG_LEVEL=${{ github.event.inputs.log_level }}" >> $GITHUB_ENV + elif [ "${{ github.event_name }}" == "schedule" ]; then + echo "LOG_LEVEL=verbose" >> $GITHUB_ENV + else + echo "LOG_LEVEL=none" >> $GITHUB_ENV + fi + - name: Build all sketches if: ${{ needs.gen-chunks.outputs.build_all == 'true' }} - run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ env.MAX_CHUNKS }} 1 + run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ env.MAX_CHUNKS }} 1 ${{ env.LOG_LEVEL }} - name: Download sketches found if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }} @@ -175,7 +201,7 @@ jobs: - name: Build selected sketches if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }} - run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ needs.gen-chunks.outputs.chunk_count }} 1 sketches_found.txt + run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ needs.gen-chunks.outputs.chunk_count }} 1 ${{ env.LOG_LEVEL }} sketches_found.txt #Upload cli compile json as artifact - name: Upload cli compile json