Skip to content

Commit

Permalink
ci(build): limit run scope
Browse files Browse the repository at this point in the history
* Cancel redundant non-nightly runs and jobs dependent on canceled jobs.

* Limit scheduled runs to zmkfirmware-owned repos.
  • Loading branch information
lesshonor authored and petejohanson committed Jun 24, 2024
1 parent 7c9477b commit 9c6d1af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
schedule:
- cron: "22 4 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down Expand Up @@ -135,7 +139,7 @@ jobs:
throw new Error('Failed to build one or more configurations');
}
compile-matrix:
if: ${{ always() }}
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [core-coverage, board-changes, nightly]
outputs:
Expand Down Expand Up @@ -290,7 +294,7 @@ jobs:
});
}))).flat();
nightly:
if: ${{ github.event_name == 'schedule' }}
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'zmkfirmware' }}
runs-on: ubuntu-latest
needs: get-grouped-hardware
outputs:
Expand Down

0 comments on commit 9c6d1af

Please sign in to comment.