@@ -3,36 +3,33 @@ name: Subworkflow Test Install Scripts Debian
3
3
on :
4
4
workflow_call :
5
5
inputs :
6
- runs_on :
7
- required : true
8
- type : string
9
- platform :
10
- required : true
11
- type : string
12
6
debian_codename :
13
7
required : true
14
8
type : string
15
- cache_scope :
9
+ platform :
16
10
required : true
17
11
type : string
18
12
docker_image_name :
19
- required : true
20
- type : string
21
- matrix_usernames :
22
- required : true
13
+ required : false
23
14
type : string
24
- matrix_test_scripts :
25
- required : true
15
+ default : rpi-jukebox-rfid
16
+ cache_scope :
17
+ required : false
26
18
type : string
19
+ default : ${{ github.ref }}-test-debian
27
20
local_registry_port :
28
21
required : false
29
22
type : number
30
23
default : 5000
24
+ runs_on :
25
+ required : false
26
+ type : string
27
+ default : ubuntu-latest
31
28
32
29
# let only one instance run the test so cache is not corrupted.
33
30
# cancel already running instances as only the last run will be relevant
34
31
concurrency :
35
- group : ${{ inputs.cache_scope }}-${{ inputs.debian_codename }}
32
+ group : ${{ inputs.cache_scope }}-${{ inputs.debian_codename }}-${{ inputs.platform }}
36
33
cancel-in-progress : true
37
34
38
35
jobs :
45
42
cache_key : ${{ steps.vars.outputs.cache_key }}
46
43
image_file_name : ${{ steps.vars.outputs.image_file_name }}
47
44
image_tag_name : ${{ steps.vars.outputs.image_tag_name }}
45
+ docker_run_options : ${{ steps.vars.outputs.docker_run_options }}
48
46
49
47
# create local docker registry to use locally build images
50
48
services :
@@ -71,22 +69,28 @@ jobs:
71
69
DEBIAN_CODENAME : ${{ inputs.debian_codename }}
72
70
DOCKER_IMAGE_NAME : ${{ inputs.docker_image_name }}
73
71
CACHE_SCOPE : ${{ inputs.cache_scope }}
72
+ PLATFORM : ${{ inputs.platform }}
74
73
run : |
75
- echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_CODENAME }}-test" >> $GITHUB_OUTPUT
76
- echo "image_file_name=${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_CODENAME }}.tar" >> $GITHUB_OUTPUT
77
- echo "cache_scope=${{ env.CACHE_SCOPE }}-${{ env.DEBIAN_CODENAME }}" >> $GITHUB_OUTPUT
74
+ PLATFORM=${PLATFORM////_}
75
+ echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_CODENAME }}-${PLATFORM}-test" >> $GITHUB_OUTPUT
76
+ echo "image_file_name=${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_CODENAME }}-${PLATFORM}.tar" >> $GITHUB_OUTPUT
77
+ echo "cache_scope=${{ env.CACHE_SCOPE }}-${{ env.DEBIAN_CODENAME }}-${PLATFORM}" >> $GITHUB_OUTPUT
78
78
79
79
- name : Set Output vars
80
80
id : vars
81
81
env :
82
82
LOCAL_REGISTRY_PORT : ${{ inputs.local_registry_port }}
83
+ PLATFORM : ${{ inputs.platform }}
83
84
run : |
84
85
echo "image_tag_name=${{ steps.pre-vars.outputs.image_tag_name }}" >> $GITHUB_OUTPUT
85
86
echo "image_tag_name_local_base=localhost:${{ env.LOCAL_REGISTRY_PORT }}/${{ steps.pre-vars.outputs.image_tag_name }}-base" >> $GITHUB_OUTPUT
86
87
echo "image_file_name=${{ steps.pre-vars.outputs.image_file_name }}" >> $GITHUB_OUTPUT
87
88
echo "image_file_path=./${{ steps.pre-vars.outputs.image_file_name }}" >> $GITHUB_OUTPUT
88
89
echo "cache_scope=${{ steps.pre-vars.outputs.cache_scope }}" >> $GITHUB_OUTPUT
89
90
echo "cache_key=${{ steps.pre-vars.outputs.cache_scope }}-${{ github.sha }}#${{ github.run_attempt }}" >> $GITHUB_OUTPUT
91
+ if [ "${{ env.PLATFORM }}" == "linux/arm/v6" ] ; then
92
+ echo "docker_run_options=-e QEMU_CPU=arm1176" >> $GITHUB_OUTPUT
93
+ fi
90
94
91
95
# Build base image for debian version name. Layers will be cached and image pushes to local registry
92
96
- name : Build Image - Base
@@ -128,7 +132,7 @@ jobs:
128
132
with :
129
133
name : ${{ steps.vars.outputs.image_file_name }}
130
134
path : ${{ steps.vars.outputs.image_file_path }}
131
- retention-days : 2
135
+ retention-days : 1
132
136
133
137
134
138
# Run tests with build image
@@ -139,8 +143,12 @@ jobs:
139
143
strategy :
140
144
fail-fast : false
141
145
matrix :
142
- username : ${{ fromJSON(inputs.matrix_usernames) }}
143
- test_script : ${{ fromJSON(inputs.matrix_test_scripts) }}
146
+ username : ['pi']
147
+ test_script : ['run_installation_tests.sh', 'run_installation_tests2.sh', 'run_installation_tests3.sh']
148
+ include :
149
+ - username : ' hans'
150
+ test_script : ' run_installation_tests.sh'
151
+
144
152
145
153
steps :
146
154
- name : Set up QEMU
@@ -163,7 +171,7 @@ jobs:
163
171
uses : tj-actions/docker-run@v2
164
172
with :
165
173
image : ${{ needs.build.outputs.image_tag_name }}
166
- options : --platform ${{inputs.platform }} --user ${{ matrix.username }}
174
+ options : ${{ needs.build.outputs.docker_run_options }} --platform ${{ inputs.platform }} --user ${{ matrix.username }} --init
167
175
name : ${{ matrix.test_script }}
168
176
args : |
169
177
./${{ matrix.test_script }}
0 commit comments