@@ -36,17 +36,31 @@ jobs:
3636 - name : Checkout Repo
3737 if : ${{ matrix.attr != '' }}
3838 uses : actions/checkout@v4
39+ - name : Mount sccache disk
40+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
41+ uses : useblacksmith/stickydisk@v1
42+ with :
43+ key : ${{ github.repository }}-sccache-${{ runner.os }}-${{ runner.arch }}
44+ path : /nix/var/cache/sccache
3945 - name : Install nix (ephemeral)
4046 if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
4147 uses : ./.github/actions/nix-install-ephemeral
4248 with :
4349 push-to-cache : ' true'
50+ enable-sccache-sandbox-path : ' true'
4451 env :
4552 DEV_AWS_ROLE : ${{ secrets.DEV_AWS_ROLE }}
4653 NIX_SIGN_SECRET_KEY : ${{ secrets.NIX_SIGN_SECRET_KEY }}
4754 - name : Install nix (self-hosted)
4855 if : ${{ matrix.attr != '' && matrix.runs_on.group == 'self-hosted-runners-nix' }}
4956 uses : ./.github/actions/nix-install-self-hosted
57+ - name : Allow sccache cache write access
58+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
59+ run : |
60+ sudo chgrp nixbld /nix/var/cache/sccache
61+ sudo chmod 777 /nix/var/cache/sccache
62+ sudo chmod g+s /nix/var/cache/sccache
63+ sudo setfacl -d -m u::rwX,g::rwX,o::rwX /nix/var/cache/sccache
5064 - name : nix build
5165 if : ${{ matrix.attr != '' }}
5266 shell : bash
@@ -67,17 +81,31 @@ jobs:
6781 - name : Checkout Repo
6882 if : ${{ matrix.attr != '' }}
6983 uses : actions/checkout@v4
84+ - name : Mount sccache disk
85+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
86+ uses : useblacksmith/stickydisk@v1
87+ with :
88+ key : ${{ github.repository }}-sccache-${{ runner.os }}-${{ runner.arch }}
89+ path : /nix/var/cache/sccache
7090 - name : Install nix (ephemeral)
7191 if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
7292 uses : ./.github/actions/nix-install-ephemeral
7393 with :
7494 push-to-cache : ' true'
95+ enable-sccache-sandbox-path : ' true'
7596 env :
7697 DEV_AWS_ROLE : ${{ secrets.DEV_AWS_ROLE }}
7798 NIX_SIGN_SECRET_KEY : ${{ secrets.NIX_SIGN_SECRET_KEY }}
7899 - name : Install nix (self-hosted)
79100 if : ${{ matrix.attr != '' && matrix.runs_on.group == 'self-hosted-runners-nix' }}
80101 uses : ./.github/actions/nix-install-self-hosted
102+ - name : Allow sccache cache write access
103+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
104+ run : |
105+ sudo chgrp nixbld /nix/var/cache/sccache
106+ sudo chmod 777 /nix/var/cache/sccache
107+ sudo chmod g+s /nix/var/cache/sccache
108+ sudo setfacl -d -m u::rwX,g::rwX,o::rwX /nix/var/cache/sccache
81109 - name : nix build
82110 if : ${{ matrix.attr != '' }}
83111 shell : bash
@@ -144,14 +172,28 @@ jobs:
144172 - name : Checkout Repo
145173 if : ${{ matrix.attr != '' }}
146174 uses : actions/checkout@v4
175+ - name : Mount sccache disk
176+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
177+ uses : useblacksmith/stickydisk@v1
178+ with :
179+ key : ${{ github.repository }}-sccache-${{ runner.os }}-${{ runner.arch }}
180+ path : /nix/var/cache/sccache
147181 - name : Install nix
148182 if : ${{ matrix.attr != '' }}
149183 uses : ./.github/actions/nix-install-ephemeral
150184 with :
185+ enable-sccache-sandbox-path : ' true'
151186 push-to-cache : ' true'
152187 env :
153188 DEV_AWS_ROLE : ${{ secrets.DEV_AWS_ROLE }}
154189 NIX_SIGN_SECRET_KEY : ${{ secrets.NIX_SIGN_SECRET_KEY }}
190+ - name : Allow sccache cache write access
191+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
192+ run : |
193+ sudo chgrp nixbld /nix/var/cache/sccache
194+ sudo chmod 777 /nix/var/cache/sccache
195+ sudo chmod g+s /nix/var/cache/sccache
196+ sudo setfacl -d -m u::rwX,g::rwX,o::rwX /nix/var/cache/sccache
155197 - name : nix build
156198 if : ${{ matrix.attr != '' }}
157199 shell : bash
@@ -172,14 +214,28 @@ jobs:
172214 - name : Checkout Repo
173215 if : ${{ matrix.attr != '' }}
174216 uses : actions/checkout@v4
217+ - name : Mount sccache disk
218+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
219+ uses : useblacksmith/stickydisk@v1
220+ with :
221+ key : ${{ github.repository }}-sccache-${{ runner.os }}-${{ runner.arch }}
222+ path : /nix/var/cache/sccache
175223 - name : Install nix
176224 if : ${{ matrix.attr != '' }}
177225 uses : ./.github/actions/nix-install-ephemeral
178226 with :
227+ enable-sccache-sandbox-path : ' true'
179228 push-to-cache : ' true'
180229 env :
181230 DEV_AWS_ROLE : ${{ secrets.DEV_AWS_ROLE }}
182231 NIX_SIGN_SECRET_KEY : ${{ secrets.NIX_SIGN_SECRET_KEY }}
232+ - name : Allow sccache cache write access
233+ if : ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
234+ run : |
235+ sudo chgrp nixbld /nix/var/cache/sccache
236+ sudo chmod 777 /nix/var/cache/sccache
237+ sudo chmod g+s /nix/var/cache/sccache
238+ sudo setfacl -d -m u::rwX,g::rwX,o::rwX /nix/var/cache/sccache
183239 - name : nix build
184240 if : ${{ matrix.attr != '' }}
185241 shell : bash
0 commit comments