ci(build): limit run scope

* Cancel redundant non-nightly runs and jobs dependent on canceled jobs.

* Limit scheduled runs to zmkfirmware-owned repos.
This commit is contained in:
honorless 2024-03-25 14:43:54 -04:00 committed by Pete Johanson
parent 7c9477be6e
commit 9c6d1af102

View file

@ -12,6 +12,10 @@ on:
schedule: schedule:
- cron: "22 4 * * *" - cron: "22 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
permissions: {} permissions: {}
jobs: jobs:
@ -135,7 +139,7 @@ jobs:
throw new Error('Failed to build one or more configurations'); throw new Error('Failed to build one or more configurations');
} }
compile-matrix: compile-matrix:
if: ${{ always() }} if: ${{ !cancelled() }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [core-coverage, board-changes, nightly] needs: [core-coverage, board-changes, nightly]
outputs: outputs:
@ -290,7 +294,7 @@ jobs:
}); });
}))).flat(); }))).flat();
nightly: nightly:
if: ${{ github.event_name == 'schedule' }} if: ${{ github.event_name == 'schedule' && github.repository_owner == 'zmkfirmware' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get-grouped-hardware needs: get-grouped-hardware
outputs: outputs: