From 49ceda66a2afdbed0d9540bccfe3badb83b26ce1 Mon Sep 17 00:00:00 2001 From: "Xu, Zefan" Date: Thu, 13 Jun 2024 08:34:45 +0800 Subject: [PATCH] MISC: skip CI for commits that do not modify core sources. (#3064) --- .github/filters.yaml | 6 ++++++ .github/workflows/emu.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/filters.yaml diff --git a/.github/filters.yaml b/.github/filters.yaml new file mode 100644 index 0000000000..ff064ac5cc --- /dev/null +++ b/.github/filters.yaml @@ -0,0 +1,6 @@ +core: + - "!.github/ISSUE_TEMPLATE/**" + - "!.github/CODEOWNERS" + - "!.github/filters.yaml" + - "!**/*.md" + - "!LICENSE" diff --git a/.github/workflows/emu.yml b/.github/workflows/emu.yml index 38d983e54a..f541968bf4 100644 --- a/.github/workflows/emu.yml +++ b/.github/workflows/emu.yml @@ -8,8 +8,26 @@ on: branches: [ master ] jobs: + changes: # Changes Detection + name: Changes Detection + runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + core: ${{ steps.filter.outputs.core }} + steps: + - uses: actions/checkout@v2 + - uses: dorny/paths-filter@v3 + id: filter + with: + predicate-quantifier: 'every' + filters: .github/filters.yaml generate-verilog: runs-on: bosc + needs: changes + if: ${{ needs.changes.outputs.core == 'true' }} continue-on-error: false timeout-minutes: 900 name: Generate Verilog @@ -49,6 +67,8 @@ jobs: python3 $GITHUB_WORKSPACE/scripts/xiangshan.py --generate --config KunminghuV2Config --release --mfc emu-basics: runs-on: bosc + needs: changes + if: ${{ needs.changes.outputs.core == 'true' }} continue-on-error: false timeout-minutes: 900 name: EMU - Basics @@ -106,6 +126,8 @@ jobs: cat perf.log | sort | tee $PERF_HOME/copy_and_run.log emu-performance: runs-on: bosc + needs: changes + if: ${{ needs.changes.outputs.core == 'true' }} continue-on-error: false timeout-minutes: 900 name: EMU - Performance @@ -169,6 +191,8 @@ jobs: cat perf.log | sort | tee $PERF_HOME/astar.log emu-mc: runs-on: bosc + needs: changes + if: ${{ needs.changes.outputs.core == 'true' }} continue-on-error: false timeout-minutes: 900 name: EMU - MC @@ -203,6 +227,8 @@ jobs: python3 $GITHUB_WORKSPACE/scripts/xiangshan.py --wave-dump $WAVE_HOME --threads 16 --numa --diff ./ready-to-run/riscv64-nemu-interpreter-dual-so --ci linux-hello-smp-new 2> /dev/zero # simv-basics: # runs-on: bosc + # needs: changes + # if: ${{ needs.changes.outputs.core == 'true' }} # continue-on-error: false # timeout-minutes: 900 # name: SIMV - Basics