Skip to content

Commit dbf4c63

Browse files
committed
build: gha: actions/checkout: don't clean working copy & fetch full history 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 <ricardo@pardini.net>
1 parent 3ec22df commit dbf4c63

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build-all-matrix.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ jobs:
6666
steps:
6767
- name: Checkout build repo
6868
uses: actions/checkout@v4
69+
with: { clean: false, fetch-depth: 0 }
70+
71+
- name: Cleanup directories
72+
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
6973

7074
- name: Set up QEMU
7175
uses: docker/setup-qemu-action@v3
@@ -100,6 +104,10 @@ jobs:
100104
steps:
101105
- name: Checkout build repo
102106
uses: actions/checkout@v4
107+
with: { clean: false, fetch-depth: 0 }
108+
109+
- name: Cleanup directories
110+
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
103111

104112
- name: Set up Docker Buildx # nb: no need for qemu here, kernels are cross-compiled, instead of the compilation being emulated
105113
uses: docker/setup-buildx-action@v3
@@ -130,6 +138,10 @@ jobs:
130138
steps:
131139
- name: Checkout build repo
132140
uses: actions/checkout@v4
141+
with: { clean: false, fetch-depth: 0 }
142+
143+
- name: Cleanup directories
144+
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
133145

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

0 commit comments

Comments
 (0)