diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 997b0c13..687adea5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1be659b3..349cd36f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 856051d8..e6cc1707 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 00000000..d13c0a59 --- /dev/null +++ b/.github/workflows/setup.yml @@ -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 }}