Skip to content

Commit

Permalink
build(gha): run setup before other jobs to improve speeds
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Jul 10, 2024
1 parent e661ac9 commit a740b34
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ concurrency:
cancel-in-progress: true

jobs:
# Run setup initially to save cache and time on subsequent jobs
setup:
uses: ./.github/workflows/setup.yml
secrets: inherit

bundlewatch:
needs: setup
uses: ./.github/workflows/bundlewatch.yml
secrets: inherit

test:
needs: setup
uses: ./.github/workflows/test.yml
secrets: inherit

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@ jobs:
- uses: myparcelnl/actions/has-refs-between@v4
id: has-refs

bundlewatch:
# Run setup initially to save cache and time on subsequent jobs
setup:
needs: prepare
if: steps.prepare.outputs.has-refs == 'true'
uses: ./.github/workflows/setup.yml
secrets: inherit

bundlewatch:
needs: setup
uses: ./.github/workflows/bundlewatch.yml
secrets: inherit

test:
needs: prepare
if: steps.prepare.outputs.has-refs == 'true'
needs: setup
uses: ./.github/workflows/test.yml
secrets: inherit

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ concurrency:
cancel-in-progress: true

jobs:
# Run setup initially to save cache and time on subsequent jobs
setup:
uses: ./.github/workflows/setup.yml
secrets: inherit

bundlewatch:
needs: setup
uses: ./.github/workflows/bundlewatch.yml
secrets: inherit

test:
needs: setup
uses: ./.github/workflows/test.yml
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Setup'

on: workflow_call

jobs:
setup:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: myparcelnl/actions/yarn-install@v4
with:
node-version: ${{ vars.NODE_VERSION }}

0 comments on commit a740b34

Please sign in to comment.