diff options
| author | hathach <[email protected]> | 2026-02-07 17:31:53 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-02-07 17:31:53 +0700 |
| commit | 4632441ae7b48f1d1a32ef99e05991ea1e41f6f4 (patch) | |
| tree | a0f13015d4330556a62279cad7e29aacca1be9fd | |
| parent | dde5f1dc710424616daa9404931f6fa4c9ca0b1c (diff) | |
add back check-path job to path filter, make sure workflow always run to register commit chain with membrowse
| -rw-r--r-- | .github/workflows/build.yml | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ded4e816c..b9e1b6201 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,30 +4,7 @@ on: workflow_dispatch: push: branches: [master] - paths: - - 'src/**' - - 'examples/**' - - 'lib/**' - - 'hw/**' - - 'tools/build.py' - - 'tools/get_deps.py' - - '.github/actions/**' - - '.github/workflows/build.yml' - - '.github/workflows/build_util.yml' - - '.github/workflows/ci_set_matrix.py' pull_request: - paths: - - 'src/**' - - 'examples/**' - - 'lib/**' - - 'hw/**' - - 'test/hil/**' - - 'tools/build.py' - - 'tools/get_deps.py' - - '.github/actions/**' - - '.github/workflows/build.yml' - - '.github/workflows/build_util.yml' - - '.github/workflows/ci_set_matrix.py' release: types: [ published ] @@ -39,7 +16,39 @@ env: HIL_JSON: test/hil/tinyusb.json jobs: + # Check if the code changes and we need to run ci build + # Cannot use paths filter in the on-event since we want this workflow to run even no code change to register commit chain + check-paths: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + code_changed: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 2 # Needed for push commit comparison + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + - 'test/hil/**' + - 'tools/build.py' + - 'tools/get_deps.py' + - '.github/actions/**' + - '.github/workflows/build.yml' + - '.github/workflows/build_util.yml' + - '.github/workflows/ci_set_matrix.py' + set-matrix: + needs: [ check-paths ] + if: needs.check-paths.outputs.code_changed == 'true' runs-on: ubuntu-latest outputs: json: ${{ steps.set-matrix-json.outputs.matrix }} @@ -184,6 +193,8 @@ jobs: # Build Make/CMake on Windows/MacOS # --------------------------------------- build-os: + needs: [ check-paths ] + if: needs.check-paths.outputs.code_changed == 'true' uses: ./.github/workflows/build_util.yml strategy: fail-fast: false @@ -200,8 +211,9 @@ jobs: # Zephyr # --------------------------------------- zephyr: + needs: [ check-paths ] # skip zephyr build due to failed build, fix later - if: false + if: false && needs.check-paths.outputs.code_changed == 'true' runs-on: ubuntu-latest steps: - name: Checkout TinyUSB @@ -283,6 +295,7 @@ jobs: # Since IAR Token secret is not passed to forked PR, only build non-forked PR # --------------------------------------- hil-hfp: + needs: [ check-paths ] if: | github.repository_owner == 'hathach' && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true) |
