@@ -101,15 +101,26 @@ jobs:
101101 run : nix flake check --impure
102102
103103 - name : Build components
104- run : nix develop --impure .#ci -c make -j 3 build
104+ run : |
105+ # On Depot runners, cgo external linking can spill large temporary linker
106+ # files into /run via the default temp dir. Keep Go and system temp files
107+ # on the workspace disk for this step to avoid "no space left on device",
108+ # while still allowing each parallel go build to get its own temp dir.
109+ mkdir -p \
110+ "$GITHUB_WORKSPACE/.tmp/go-work" \
111+ "$GITHUB_WORKSPACE/.tmp/system"
112+ env \
113+ GOTMPDIR="$GITHUB_WORKSPACE/.tmp/go-work" \
114+ TMPDIR="$GITHUB_WORKSPACE/.tmp/system" \
115+ nix develop --impure .#ci -c make -j 4 build
105116
106117 - name : Validate commit messages
107118 run : |
108119 nix develop --impure .#ci -c pre-commit run -a
109120 nix develop --impure .#ci -c pre-commit run --hook-stage manual
110121
111- generators :
112- name : Code Generators
122+ generators-openapi :
123+ name : Code Generators / OpenAPI
113124 runs-on : depot-ubuntu-latest-8
114125
115126 steps :
@@ -151,7 +162,130 @@ jobs:
151162
152163 - name : Ensure code generators are run
153164 run : |
154- nix develop --impure .#ci -c make generate-all
165+ nix develop --impure .#ci -c make update-openapi
166+
167+ # does not detect new files
168+ if [ -n "$(git diff --exit-code)" ]; then
169+ git diff
170+
171+ echo "Code generators have not been run, please run 'make generate-all' and commit the changes"
172+ exit 1
173+ fi
174+
175+ # detect files not committed
176+ if [ -n "$(git status --porcelain)" ]; then
177+ git status --porcelain
178+
179+ echo "Code generators have not been run, please run 'make generate-all' and commit the changes"
180+ exit 1
181+ fi
182+
183+ generators-javascript-sdk :
184+ name : Code Generators / JavaScript SDK
185+ runs-on : depot-ubuntu-latest-8
186+
187+ steps :
188+ - name : Checkout repository
189+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
190+ with :
191+ persist-credentials : false
192+
193+ - name : Set up Nix
194+ uses : nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
195+ with :
196+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
197+ nix_conf : |
198+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
199+ keep-env-derivations = true
200+ keep-outputs = true
201+
202+ - name : Restore Nix store
203+ uses : nix-community/cache-nix-action/restore@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
204+ with :
205+ primary-key : ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-${{ hashFiles('flake.*') }}
206+ restore-prefixes-first-match : |
207+ ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-
208+ ${{ runner.os }}-openmeter-nix-build-main-${{ hashFiles('flake.*') }}
209+ ${{ runner.os }}-openmeter-nix-build-main-
210+ ${{ runner.os }}-openmeter-nix-build-
211+
212+ - name : Restore go.mod cache if exists
213+ uses : actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
214+ with :
215+ path : .devenv/state/go
216+ key : ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
217+ # Prefer to restore the branch cache over the main cache
218+ restore-keys : |
219+ ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
220+ ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-
221+ ${{ runner.os }}-openmeter-go-modules-main-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
222+ ${{ runner.os }}-openmeter-go-modules-main
223+
224+ - name : Ensure code generators are run
225+ run : |
226+ nix develop --impure .#ci -c make generate-javascript-sdk
227+
228+ # does not detect new files
229+ if [ -n "$(git diff --exit-code)" ]; then
230+ git diff
231+
232+ echo "Code generators have not been run, please run 'make generate-all' and commit the changes"
233+ exit 1
234+ fi
235+
236+ # detect files not committed
237+ if [ -n "$(git status --porcelain)" ]; then
238+ git status --porcelain
239+
240+ echo "Code generators have not been run, please run 'make generate-all' and commit the changes"
241+ exit 1
242+ fi
243+
244+ generators-go :
245+ name : Code Generators / Go
246+ runs-on : depot-ubuntu-latest-8
247+
248+ steps :
249+ - name : Checkout repository
250+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
251+ with :
252+ persist-credentials : false
253+
254+ - name : Set up Nix
255+ uses : nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
256+ with :
257+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
258+ nix_conf : |
259+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
260+ keep-env-derivations = true
261+ keep-outputs = true
262+
263+ - name : Restore Nix store
264+ uses : nix-community/cache-nix-action/restore@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
265+ with :
266+ primary-key : ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-${{ hashFiles('flake.*') }}
267+ restore-prefixes-first-match : |
268+ ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-
269+ ${{ runner.os }}-openmeter-nix-build-main-${{ hashFiles('flake.*') }}
270+ ${{ runner.os }}-openmeter-nix-build-main-
271+ ${{ runner.os }}-openmeter-nix-build-
272+
273+ - name : Restore go.mod cache if exists
274+ uses : actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
275+ with :
276+ path : .devenv/state/go
277+ key : ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
278+ # Prefer to restore the branch cache over the main cache
279+ restore-keys : |
280+ ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
281+ ${{ runner.os }}-openmeter-go-modules-${{ github.ref_name }}-
282+ ${{ runner.os }}-openmeter-go-modules-main-${{ hashFiles('flake.*', 'go.*', '.github/workflows/*.yaml') }}
283+ ${{ runner.os }}-openmeter-go-modules-main
284+
285+ - name : Ensure code generators are run
286+ run : |
287+ nix develop --impure .#ci -c make patch-oapi-templates
288+ nix develop --impure .#ci -c go generate ./...
155289
156290 # does not detect new files
157291 if [ -n "$(git diff --exit-code)" ]; then
@@ -232,7 +366,16 @@ jobs:
232366 SVIX_JWT_SECRET : DUMMY_JWT_SECRET
233367 # count=1 is needed to force retest
234368 run : |
235- nix develop --impure .#ci -c make test-nocache
369+ # On Depot runners, cgo builds during tests can spill temporary files
370+ # into /run via the default temp dir. Keep Go and system temp files on
371+ # the workspace disk for this step to avoid "no space left on device".
372+ mkdir -p \
373+ "$GITHUB_WORKSPACE/.tmp/go-work" \
374+ "$GITHUB_WORKSPACE/.tmp/system"
375+ env \
376+ GOTMPDIR="$GITHUB_WORKSPACE/.tmp/go-work" \
377+ TMPDIR="$GITHUB_WORKSPACE/.tmp/system" \
378+ nix develop --impure .#ci -c make test-nocache
236379
237380 - name : Stop docker-compose dependencies
238381 if : always()
@@ -441,6 +584,14 @@ jobs:
441584
442585 cat quickstart/docker-compose.override.yaml
443586
587+ - name : Debug quickstart runner state
588+ run : |
589+ echo "### DEBUG"
590+ ss -ltnp | grep ':49000 ' || true
591+ docker ps -a
592+ docker network ls
593+ echo "### DEBUG"
594+
444595 - name : Launch Docker Compose
445596 run : docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
446597 working-directory : quickstart
@@ -523,6 +674,14 @@ jobs:
523674
524675 cat e2e/docker-compose.override.yaml
525676
677+ - name : Debug E2E runner state
678+ run : |
679+ echo "### DEBUG"
680+ ss -ltnp | grep ':39000 ' || true
681+ docker ps -a
682+ docker network ls
683+ echo "### DEBUG"
684+
526685 - name : Launch Docker Compose infra
527686 run : docker compose -f docker-compose.infra.yaml -f docker-compose.openmeter.yaml -f docker-compose.override.yaml up -d
528687 working-directory : e2e
0 commit comments