How to organize a composite CI workflow while preventing multiple checkouts of the same repository? #172900
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You can avoid multiple 15 GB checkouts by using a single initial checkout + artifact/cache sharing across jobs: Option 1: Cache strategy
Option 2: Upload + download artifacts
Option 3: Matrix build
This way:
👉 Example (simplified): jobs:
prepare:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: source
path: .
build:
needs: prepare
strategy:
matrix:
project: [proj1, proj2, proj3]
runs-on: self-hosted
steps:
- uses: actions/download-artifact@v4
with:
name: source
- run: build ${{ matrix.project }}
This pattern prevents repeated heavy checkouts but still keeps jobs isolated. |
Beta Was this translation helpful? Give feedback.
-
|
We resolved the issue the following way: We are still using multiple co-dependant jobs. every single job and sub-action (for the matrixes) downloads the actions and references github workspace by the output variable: At the end of the process, I just call geekyeggo/delete-artifact@v5 on actions. |
Beta Was this translation helpful? Give feedback.

We resolved the issue the following way:
We are still using multiple co-dependant jobs.
prepare_repo now uploads the actions needed for the run and outputs the actual github.workspace
every single job and sub-action (for the matrixes) downloads the actions and references github workspace by the output va…