20
20
- ' scripts/**'
21
21
22
22
env :
23
- GO_VERSION : ' 1.21.12 '
23
+ GO_VERSION : ' 1.21.10 '
24
24
25
25
jobs :
26
+ setup :
27
+ # This job sets up the runners to be used in the matrix for the build workflow.
28
+ # It provides a list of available runners with stable, human-friendly names and a mapping
29
+ # from those names to the actual `runs-on` value for each runner type. This allows us to
30
+ # use codebuild-hosted runners for awslabs/soci-snapshotter without requiring forks to also
31
+ # have codebuild-hosted runners.
32
+ #
33
+ # If you want to use codebuild runners for your personal fork, follow the instructions to set
34
+ # up a codebuild project. https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html
35
+ # Then, replace 'soci-snapshotter-instance' with the name of the project you created.
36
+ name : Setup Build Matrix
37
+ runs-on : ubuntu-latest
38
+ if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'awslabs/soci-snapshotter'
39
+ strategy :
40
+ matrix :
41
+ # We're using a matrix with a single entry so that we can define some config as YAML rather than
42
+ # having to write escaped json in a string.
43
+ include :
44
+ - use-codebuild : ${{ github.repository_owner == 'awslabs' }}
45
+ runs-on-names-cb : [ubuntu-x86, al2-arm]
46
+ runs-on-names : [ubuntu]
47
+ runner-labels :
48
+ ubuntu : ubuntu-22.04
49
+ ubuntu-x86 : " codebuild-soci-snapshotter-instance-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-xlarge"
50
+ al2-arm : " codebuild-soci-snapshotter-instance-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large"
51
+ outputs :
52
+ available-runners : ${{ matrix.use-codebuild && toJSON(matrix.runs-on-names-cb) || toJSON(matrix.runs-on-names) }}
53
+ runner-labels : ${{ toJSON(matrix.runner-labels) }}
54
+ steps :
55
+ - name : Dump Config
56
+ run : echo '${{ toJSON(matrix) }}'
57
+
26
58
test :
27
- runs-on : ubuntu-20.04
59
+ needs : setup
60
+ runs-on : ${{ fromJSON(needs.setup.outputs.runner-labels)[matrix.os] }}
61
+ strategy :
62
+ matrix :
63
+ os : ${{ fromJSON(needs.setup.outputs.available-runners) }}
28
64
timeout-minutes : 15
29
65
steps :
30
66
- uses : actions/checkout@v4
31
67
- uses : actions/setup-go@v5
32
68
with :
33
69
go-version : ${{ env.GO_VERSION }}
70
+ - name : Install zlib static on AL2 ARM instances
71
+ if : matrix.os == 'al2-arm'
72
+ run : dnf install zlib-static.aarch64 -y
34
73
- run : make
35
74
- run : make test
75
+
36
76
integration :
37
- runs-on : ubuntu-20.04
77
+ needs : setup
78
+ runs-on : ${{ fromJSON(needs.setup.outputs.runner-labels)[matrix.os] }}
38
79
timeout-minutes : 40
39
80
strategy :
40
- fail-fast : false
41
81
matrix :
42
- containerd : ["1.6.33", "1.7.18", "2.0.0-rc.3"]
82
+ os : ${{ fromJSON(needs.setup.outputs.available-runners) }}
83
+ containerd : ["1.6.30", "1.7.14"]
43
84
env :
44
85
DOCKER_BUILD_ARGS : " CONTAINERD_VERSION=${{ matrix.containerd }}"
45
86
steps :
46
87
- uses : actions/checkout@v4
47
88
- uses : actions/setup-go@v5
48
89
with :
49
90
go-version : ${{ env.GO_VERSION }}
50
- - run : make integration
91
+ - name : Install zlib static on AL2 ARM instances
92
+ if : matrix.os == 'al2-arm'
93
+ run : dnf install zlib-static.aarch64 -y
94
+ - run : make integration
0 commit comments