From 07587652f55f500aedf9273d5fb829a2a324c1a2 Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Mon, 15 Dec 2025 13:02:25 +0100 Subject: [PATCH 1/5] add ci workflow to check sketches deps --- .github/workflows/check-sketches-deps.yml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/check-sketches-deps.yml diff --git a/.github/workflows/check-sketches-deps.yml b/.github/workflows/check-sketches-deps.yml new file mode 100644 index 0000000..3524448 --- /dev/null +++ b/.github/workflows/check-sketches-deps.yml @@ -0,0 +1,34 @@ +name: Check sketches dependencies +on: + pull_request: +permissions: + contents: read + +jobs: + check-sketches-deps: + runs-on: ubuntu-latest + env: + ARDUINO_CLI_PATH: '/home/runner/bin' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install the latest version of Arduino CLI + run: | + mkdir -p ${{ env.ARDUINO_CLI_PATH }} + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=${{ env.ARDUINO_CLI_PATH }} sh + + - name: Update Arduino cores and libraries and install Zephyr core + run: | + export PATH="${{ env.ARDUINO_CLI_PATH }}:$PATH" + arduino-cli update + arduino-cli core install arduino:zephyr + + - name: Verify sketches + run: | + export PATH="${{ env.ARDUINO_CLI_PATH }}:$PATH" + SKETCHES=$(find . -name "*.ino") + for SKETCH in $SKETCHES; do + echo "Verifying $SKETCH" + arduino-cli compile --fqbn arduino:zephyr:unoq "$SKETCH" + done From e1ce8287f20bc43adbda7d560e439c6adc757589 Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Wed, 17 Dec 2025 16:18:11 +0100 Subject: [PATCH 2/5] use compile-sketches ga --- .github/workflows/check-sketches-deps.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/check-sketches-deps.yml b/.github/workflows/check-sketches-deps.yml index 3524448..e8a8f0e 100644 --- a/.github/workflows/check-sketches-deps.yml +++ b/.github/workflows/check-sketches-deps.yml @@ -13,22 +13,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install the latest version of Arduino CLI - run: | - mkdir -p ${{ env.ARDUINO_CLI_PATH }} - curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=${{ env.ARDUINO_CLI_PATH }} sh - - - name: Update Arduino cores and libraries and install Zephyr core - run: | - export PATH="${{ env.ARDUINO_CLI_PATH }}:$PATH" - arduino-cli update - arduino-cli core install arduino:zephyr - - name: Verify sketches - run: | - export PATH="${{ env.ARDUINO_CLI_PATH }}:$PATH" - SKETCHES=$(find . -name "*.ino") - for SKETCH in $SKETCHES; do - echo "Verifying $SKETCH" - arduino-cli compile --fqbn arduino:zephyr:unoq "$SKETCH" - done + uses: arduino/compile-sketches@v1 + with: + fqbn: "arduino:zephyr:unoq" + sketch-paths: "./examples" \ No newline at end of file From b542ab9ba09348de3eba0258897ba86c0755712e Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Wed, 17 Dec 2025 16:56:36 +0100 Subject: [PATCH 3/5] remove useless stuff --- .github/workflows/check-sketches-deps.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-sketches-deps.yml b/.github/workflows/check-sketches-deps.yml index e8a8f0e..fe362fa 100644 --- a/.github/workflows/check-sketches-deps.yml +++ b/.github/workflows/check-sketches-deps.yml @@ -1,14 +1,12 @@ -name: Check sketches dependencies +name: Compile sketches to verify dependencies on: pull_request: permissions: contents: read jobs: - check-sketches-deps: + compile-sketches: runs-on: ubuntu-latest - env: - ARDUINO_CLI_PATH: '/home/runner/bin' steps: - name: Checkout repository uses: actions/checkout@v4 From f5680a6447e41cb53f3d5aad072af64bcef0c5cf Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Thu, 18 Dec 2025 14:33:16 +0100 Subject: [PATCH 4/5] get cli version from arduino-app-cli --- .github/workflows/check-sketches-deps.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check-sketches-deps.yml b/.github/workflows/check-sketches-deps.yml index fe362fa..c826825 100644 --- a/.github/workflows/check-sketches-deps.yml +++ b/.github/workflows/check-sketches-deps.yml @@ -8,11 +8,25 @@ jobs: compile-sketches: runs-on: ubuntu-latest steps: + # Checkout arduino-app-cli to extract the version from go.mod file dynamically. + # This ensures that the same version of arduino-cli is used as a dependency. + - name: Checkout arduino-app-cli repository + uses: actions/checkout@v4 + with: + repository: arduino/arduino-app-cli + + - name: Extract cli-version from go.mod + id: get_cli_version + run: | + CLI_VERSION=$(grep 'github.com/arduino/arduino-cli ' go.mod | awk '{print $2}' | sed 's/^v//') + echo "cli_version=$CLI_VERSION" >> $GITHUB_OUTPUT + - name: Checkout repository uses: actions/checkout@v4 - name: Verify sketches uses: arduino/compile-sketches@v1 with: + cli-version: ${{ steps.get_cli_version.outputs.cli_version }} fqbn: "arduino:zephyr:unoq" sketch-paths: "./examples" \ No newline at end of file From 5575ba1c1354ae945018602fabdf5d4fedf97edd Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Thu, 18 Dec 2025 15:27:55 +0100 Subject: [PATCH 5/5] Revert "get cli version from arduino-app-cli" This reverts commit f5680a6447e41cb53f3d5aad072af64bcef0c5cf. --- .github/workflows/check-sketches-deps.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/check-sketches-deps.yml b/.github/workflows/check-sketches-deps.yml index c826825..fe362fa 100644 --- a/.github/workflows/check-sketches-deps.yml +++ b/.github/workflows/check-sketches-deps.yml @@ -8,25 +8,11 @@ jobs: compile-sketches: runs-on: ubuntu-latest steps: - # Checkout arduino-app-cli to extract the version from go.mod file dynamically. - # This ensures that the same version of arduino-cli is used as a dependency. - - name: Checkout arduino-app-cli repository - uses: actions/checkout@v4 - with: - repository: arduino/arduino-app-cli - - - name: Extract cli-version from go.mod - id: get_cli_version - run: | - CLI_VERSION=$(grep 'github.com/arduino/arduino-cli ' go.mod | awk '{print $2}' | sed 's/^v//') - echo "cli_version=$CLI_VERSION" >> $GITHUB_OUTPUT - - name: Checkout repository uses: actions/checkout@v4 - name: Verify sketches uses: arduino/compile-sketches@v1 with: - cli-version: ${{ steps.get_cli_version.outputs.cli_version }} fqbn: "arduino:zephyr:unoq" sketch-paths: "./examples" \ No newline at end of file