Skip to content

Commit

Permalink
build: gha: actions/checkout: don't clean working copy & fetch full h…
Browse files Browse the repository at this point in the history
…istory from git

- instead of cleaning the whole working copy, clean out just the `out` and `dist` dirs
- this allows the `cache/` dir to survive on-disk on self-hosted runners
- bonus: using `fetch-depth: 0` allows for much faster `git fetch` times on self-hosted runners over time
- this is done only for the jobs that can run in self-hosted runners (not prep/release jobs)

Signed-off-by: Ricardo Pardini <[email protected]>
  • Loading branch information
rpardini committed Jun 27, 2024
1 parent 3ec22df commit dbf4c63
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-all-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
steps:
- name: Checkout build repo
uses: actions/checkout@v4
with: { clean: false, fetch-depth: 0 }

- name: Cleanup directories
run: rm -rf out dist # Since we've clean:false in actions/checkout above, ensure we start fresh, still, preserve cache/ dir on self-hosted runners

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -100,6 +104,10 @@ jobs:
steps:
- name: Checkout build repo
uses: actions/checkout@v4
with: { clean: false, fetch-depth: 0 }

- name: Cleanup directories
run: rm -rf out dist # Since we've clean:false in actions/checkout above, ensure we start fresh, still, preserve cache/ dir on self-hosted runners

- name: Set up Docker Buildx # nb: no need for qemu here, kernels are cross-compiled, instead of the compilation being emulated
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -130,6 +138,10 @@ jobs:
steps:
- name: Checkout build repo
uses: actions/checkout@v4
with: { clean: false, fetch-depth: 0 }

- name: Cleanup directories
run: rm -rf out dist # Since we've clean:false in actions/checkout above, ensure we start fresh, still, preserve cache/ dir on self-hosted runners

- name: Set up Docker Buildx # nb: no need for qemu here, kernels are cross-compiled, instead of the compilation being emulated
uses: docker/setup-buildx-action@v3
Expand Down

0 comments on commit dbf4c63

Please sign in to comment.