@@ -15,8 +15,159 @@ permissions:
15
15
packages : write
16
16
17
17
jobs :
18
+ ubuntu_tests :
19
+ runs-on : ubuntu-latest
20
+ strategy :
21
+ matrix :
22
+ release : [jammy, focal, noble]
23
+ platform : [linux/amd64, linux/arm64]
24
+ fail-fast : false
25
+ steps :
26
+ - name : Copy Repo Files
27
+ uses : actions/checkout@master
28
+ - name : Get GitHub organization or user
29
+ run : echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
30
+ - name : Set up QEMU
31
+ uses : docker/setup-qemu-action@v3
32
+ - name : Set up Docker Buildx
33
+ uses : docker/setup-buildx-action@v3
34
+ - name : Copy Dockerfile
35
+ run : cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
36
+ - name : Install Goss and dgoss
37
+ run : |
38
+ curl -fsSL https://goss.rocks/install | sh
39
+ export PATH=$PATH:/usr/local/bin
40
+ - name : Get current Git SHA
41
+ id : vars
42
+ run : echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
43
+ - name : set testable image environment variable
44
+ id : testvars
45
+ run : echo "GH_RUNNER_IMAGE=ubuntu-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
46
+ - name : Login to DockerHub
47
+ uses : docker/login-action@v3
48
+ with :
49
+ username : ${{ secrets.DOCKER_USER }}
50
+ password : ${{ secrets.DOCKER_TOKEN }}
51
+ - name : Build
52
+ uses : docker/build-push-action@v6
53
+ with :
54
+ context : .
55
+ file : Dockerfile.ubuntu-${{ matrix.release }}
56
+ pull : true
57
+ push : false
58
+ load : true
59
+ tags : ${{ env.GH_RUNNER_IMAGE }}
60
+ platforms : ${{ matrix.platform }}
61
+ cache-from : type=gha
62
+ cache-to : type=gha,mode=max
63
+ # Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
64
+ - name : Run goss tests
65
+ run : |
66
+ echo "os: ubuntu" >goss_vars_${GH_RUNNER_IMAGE}.yaml
67
+ echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
68
+ echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
69
+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
70
+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
71
+ -e DEBUG_ONLY=true \
72
+ -e RUNNER_NAME=huzzah \
73
+ -e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
74
+ -e RUN_AS_ROOT=true \
75
+ -e RUNNER_NAME_PREFIX=asdf \
76
+ -e ACCESS_TOKEN=1234 \
77
+ -e APP_ID=5678 \
78
+ -e APP_PRIVATE_KEY=2345 \
79
+ -e APP_LOGIN=SOMETHING \
80
+ -e RUNNER_SCOPE=org \
81
+ -e ORG_NAME=myoung34 \
82
+ -e ENTERPRISE_NAME=emyoung34 \
83
+ -e LABELS=blue,green \
84
+ -e RUNNER_TOKEN=3456 \
85
+ -e RUNNER_WORKDIR=tmp/a \
86
+ -e RUNNER_GROUP=wat \
87
+ -e GITHUB_HOST=github.example.com \
88
+ -e DISABLE_AUTOMATIC_DEREGISTRATION=true \
89
+ -e EPHEMERAL=true \
90
+ -e DISABLE_AUTO_UPDATE=true \
91
+ ${GH_RUNNER_IMAGE} 10
92
+
93
+ debian_tests :
94
+ runs-on : ubuntu-latest
95
+ strategy :
96
+ matrix :
97
+ release : [bookworm, sid]
98
+ platform : [linux/amd64, linux/arm64]
99
+ fail-fast : false
100
+ steps :
101
+ - name : Copy Repo Files
102
+ uses : actions/checkout@master
103
+ - name : Get GitHub organization or user
104
+ run : echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
105
+ - name : Set up QEMU
106
+ uses : docker/setup-qemu-action@v3
107
+ - name : Set up Docker Buildx
108
+ uses : docker/setup-buildx-action@v3
109
+ - name : Copy Dockerfile
110
+ run : cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
111
+ - name : Install Goss and dgoss
112
+ run : |
113
+ curl -fsSL https://goss.rocks/install | sh
114
+ export PATH=$PATH:/usr/local/bin
115
+ - name : Get current Git SHA
116
+ id : vars
117
+ run : echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
118
+ - name : set testable image environment variable
119
+ id : testvars
120
+ run : echo "GH_RUNNER_IMAGE=debian-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
121
+ - name : Login to DockerHub
122
+ uses : docker/login-action@v3
123
+ with :
124
+ username : ${{ secrets.DOCKER_USER }}
125
+ password : ${{ secrets.DOCKER_TOKEN }}
126
+ - name : Build
127
+ uses : docker/build-push-action@v6
128
+ with :
129
+ context : .
130
+ file : Dockerfile.debian-${{ matrix.release }}
131
+ pull : true
132
+ push : false
133
+ load : true
134
+ tags : ${{ env.GH_RUNNER_IMAGE }}
135
+ platforms : ${{ matrix.platform }}
136
+ cache-from : type=gha
137
+ cache-to : type=gha,mode=max
138
+ # Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
139
+ - name : Run goss tests
140
+ run : |
141
+ echo "os: debian" >goss_vars_${GH_RUNNER_IMAGE}.yaml
142
+ echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
143
+ echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
144
+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
145
+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
146
+ -e DEBUG_ONLY=true \
147
+ -e RUNNER_NAME=huzzah \
148
+ -e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
149
+ -e RUN_AS_ROOT=true \
150
+ -e RUNNER_NAME_PREFIX=asdf \
151
+ -e ACCESS_TOKEN=1234 \
152
+ -e APP_ID=5678 \
153
+ -e APP_PRIVATE_KEY=2345 \
154
+ -e APP_LOGIN=SOMETHING \
155
+ -e RUNNER_SCOPE=org \
156
+ -e ORG_NAME=myoung34 \
157
+ -e ENTERPRISE_NAME=emyoung34 \
158
+ -e LABELS=blue,green \
159
+ -e RUNNER_TOKEN=3456 \
160
+ -e RUNNER_WORKDIR=tmp/a \
161
+ -e RUNNER_GROUP=wat \
162
+ -e GITHUB_HOST=github.example.com \
163
+ -e DISABLE_AUTOMATIC_DEREGISTRATION=true \
164
+ -e EPHEMERAL=true \
165
+ -e DISABLE_AUTO_UPDATE=true \
166
+ ${GH_RUNNER_IMAGE} 10
167
+
18
168
ubuntu_latest_deploy :
19
169
runs-on : ubuntu-latest
170
+ needs : ubuntu_tests
20
171
steps :
21
172
- name : Copy Repo Files
22
173
uses : actions/checkout@master
53
204
54
205
ubuntu_deploy :
55
206
runs-on : ubuntu-latest
207
+ needs : ubuntu_tests
56
208
strategy :
57
209
matrix :
58
210
release : [jammy, focal, noble]
93
245
94
246
debian_deploy :
95
247
runs-on : ubuntu-latest
248
+ needs : debian_tests
96
249
strategy :
97
250
matrix :
98
251
release : [bookworm, sid]
0 commit comments