From 65b9598c6bd4b16b6571e23eeba48d10bb5ea0ff Mon Sep 17 00:00:00 2001 From: Geir Ola Tvinnereim Date: Tue, 12 May 2026 21:39:36 +0200 Subject: [PATCH] chore: add check-src-workflow to skip micro-build --- .github/workflows/ci.yaml | 21 +++++++++++++++++---- .github/workflows/release.yaml | 17 ++++++++++++----- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 17cb992..9b69bf2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,9 +2,6 @@ name: ci on: pull_request: - branches: [main] - paths: - - 'src/**' jobs: lint: @@ -19,7 +16,23 @@ jobs: run: | find ./src \( -iname '*.h' -o -iname '*.cpp' \) -print0 | xargs -0 clang-format --dry-run --Werror - build: + check-src-changes: + runs-on: ubuntu-latest + outputs: + src_changed: ${{ steps.filter.outputs.src }} + steps: + - uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + src: + - 'src/**' + + micro-build: + needs: check-src-changes + if: needs.check-src-changes.outputs.src_changed == 'true' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7c5b29b..98b940e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,15 +16,22 @@ jobs: - name: Install build dependencies run: sudo apt install -y gcc python3 cmake gcc-arm-none-eabi binutils-arm-none-eabi - - name: Run microinstall + - name: microinstall run: | chmod +x microinstall.sh ./microinstall.sh - - - name: Run microbuild + - name: Add micro-tools to path + run: | + source ./aliases.sh + chmod +x ./aliases.sh + ./aliases.sh + - name: Copy src folder to sdk + run: | + rsync -a --delete ./src/ ./microbit-v2-sdk/source/ + - name: microbuild python run: | - chmod +x microbuild.sh - ./microbuild.sh + cd microbit-v2-sdk + python3 build.py - name: Upload MICROBIT.hex artifact uses: actions/upload-artifact@v4