Repository navigation
75 lines (69 loc) · 2.73 KB
/
Copy pathbuild-cache.yml
File metadata and controls
75 lines (69 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Registry build cache conformance
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: registry-cache-${{ github.ref }}
cancel-in-progress: true
jobs:
cache-cold:
name: Registry cache cold (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
language: [go, next]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.27.3"
- name: Verify Buildx selection and cache arguments reach the docker CLI
if: matrix.language == 'go'
run: go test ./agents/helpers/docker -run '^TestBuildx|^TestBuildOmits|^TestBuildCarries' -count=1 -v -timeout=5m
- name: Reject hidden inputs in exported cache layers
env:
CODEFLY_TEST_REGISTRY_CACHE: "1"
run: go test ./agents/helpers/docker -run '^TestMaxCacheDoesNotExportHiddenOrUnusedContext$' -v -timeout=5m
- name: Export real dependency layers through Core
env:
CODEFLY_TEST_REGISTRY_CACHE: "1"
CODEFLY_TEST_CACHE_PHASE: cold
CODEFLY_TEST_CACHE_STATE: ${{ runner.temp }}/registry-state
run: go test ./agents/helpers/docker -run '^TestLanguageRegistryCacheAcrossCleanBuilders/${{ matrix.language }}$' -v -timeout=25m
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: registry-cache-${{ matrix.language }}
path: ${{ runner.temp }}/registry-state
include-hidden-files: true
retention-days: 1
cache-warm:
name: Registry cache clean runner (${{ matrix.language }})
needs: cache-cold
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
language: [go, next]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.27.3"
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: registry-cache-${{ matrix.language }}
path: ${{ runner.temp }}/registry-state
- name: Verify source reuse and lock, base, and build-input invalidation
env:
CODEFLY_TEST_REGISTRY_CACHE: "1"
CODEFLY_TEST_CACHE_PHASE: warm
CODEFLY_TEST_CACHE_STATE: ${{ runner.temp }}/registry-state
run: go test ./agents/helpers/docker -run '^TestLanguageRegistryCacheAcrossCleanBuilders/${{ matrix.language }}$' -v -timeout=25m