diff options
| author | CYFS <[email protected]> | 2026-06-26 11:05:32 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-06-26 16:40:09 +0800 |
| commit | 64651f968a2eafc9c92bfb5c567cfa21f5ddca4f (patch) | |
| tree | 279c84bd92671d5ec9605290b61e77367f7a4180 /.github/workflows | |
| parent | c374e529c4e04b31cb4505f57f7abd217e6b62ae (diff) | |
ci: optimize membrowse target filtering
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/membrowse-report.yml | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/.github/workflows/membrowse-report.yml b/.github/workflows/membrowse-report.yml index 98ea34ea86..79c88db841 100644 --- a/.github/workflows/membrowse-report.yml +++ b/.github/workflows/membrowse-report.yml @@ -2,9 +2,35 @@ name: MemBrowse Memory Report on: pull_request: + paths: + - '.github/membrowse-targets.json' + - '.github/workflows/membrowse-report.yml' + - 'Kconfig' + - 'bsp/**' + - 'components/**' + - 'include/**' + - 'libcpu/**' + - 'src/**' + - 'tools/**' + - '!**/README*' + - '!**/readme*' + - '!bsp/**/docs/**' push: branches: - master + paths: + - '.github/membrowse-targets.json' + - '.github/workflows/membrowse-report.yml' + - 'Kconfig' + - 'bsp/**' + - 'components/**' + - 'include/**' + - 'libcpu/**' + - 'src/**' + - 'tools/**' + - '!**/README*' + - '!**/readme*' + - '!bsp/**/docs/**' concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} @@ -15,16 +41,31 @@ jobs: runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} + target_count: ${{ steps.set-matrix.outputs.target_count }} steps: - name: Checkout repository uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Collect changed files + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + git diff --name-only origin/${{ github.base_ref }}...HEAD > changed_files.txt + elif [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then + git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt + else + git diff --name-only origin/${{ github.event.repository.default_branch }}...HEAD > changed_files.txt + fi + cat changed_files.txt - name: Load target matrix id: set-matrix - run: echo "matrix=$(jq -c '.' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT + run: python3 tools/ci/membrowse_filter_targets.py --targets .github/membrowse-targets.json --changed-files changed_files.txt analyze: needs: load-targets + if: ${{ needs.load-targets.outputs.target_count != '0' }} runs-on: ubuntu-22.04 strategy: fail-fast: false |
