Skip to content

Commit

Permalink
chore: reusable workflow and adjust concurrency for pr and push
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm committed Mar 1, 2025
1 parent 987f877 commit b491a7f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
name: Continuous Integration
name: "Reusable build workflow"

on:
push:
branches:
- main

pull_request:
branches:
- main

concurrency:
group: ${{ format('ci-{0}', github.ref) }}
cancel-in-progress: true
workflow_call:

jobs:
Lint:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ci

on:
pull_request:
branches:
- main

concurrency:
group: ${{ format('ci-{0}', github.ref) }}
cancel-in-progress: true

jobs:
pr:
uses: ./.github/workflows/build.yml
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ci

on:
push:
branches:
- main

concurrency:
# On main, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/main' && format('push-{0}', github.sha) || format('push-{0}', github.ref) }}

jobs:
pr:
uses: ./.github/workflows/build.yml
secrets: inherit

0 comments on commit b491a7f

Please sign in to comment.