Skip to content

Commit

Permalink
ci(debug): Compile once a week with verbose log level
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Dec 16, 2024
1 parent 6bf6df2 commit 48b4fb0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' }}
Expand All @@ -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
Expand Down

0 comments on commit 48b4fb0

Please sign in to comment.