24
24
25
25
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
26
26
jobs :
27
+ set_env :
28
+ name : Set Environment
29
+ runs-on : ubuntu-latest
30
+ env :
31
+ BASE_IMAGE : ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
32
+ outputs :
33
+ build-matrix : ${{ steps.set-env.outputs.build-matrix }}
34
+ build-os : ${{ steps.set-env.outputs.build-os }}
35
+ steps :
36
+ - name : Set dynamic environment
37
+ id : set-env
38
+ run : |
39
+ BUILD_OS="`echo ${{ inputs.rtpp-tag }} | sed 's|-.*|| ; s|_|-|g'`"
40
+ PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
41
+ jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
42
+ sort -u | grep -v unknown | BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
43
+ echo "Platforms: ${PLATFORMS}"
44
+ BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
45
+ echo "build-os=${BUILD_OS}" >> $GITHUB_OUTPUT
46
+ echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT
47
+
27
48
build_rtp_io_dock :
28
49
name : Build OpenSIPS+rtp.io Container
50
+ needs : set_env
29
51
runs-on : ubuntu-latest
30
52
permissions :
31
53
packages : write
32
54
env :
33
55
BASE_IMAGE : ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
56
+ BUILD_OS : ${{ needs.set_env.outputs.build-os }}
34
57
outputs :
35
58
test_matrix : ${{ steps.set-env.outputs.test_matrix }}
36
59
build_image : ${{ steps.set-env.outputs.build_image }}
69
92
- name : Set dynamic environment
70
93
id : set-env
71
94
run : |
72
- BUILD_OS="`echo ${{ inputs.rtpp-tag }} | sed 's|-.*|| ; s|_|-|g'`"
73
- echo "BUILD_OS=${BUILD_OS}" >> $GITHUB_ENV
74
95
PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
75
96
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
76
- sort -u | grep -v unknown | BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
97
+ sort -u | grep -v unknown | ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
77
98
echo "Platforms: ${PLATFORMS}"
78
99
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
79
100
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
83
104
echo "BUILD_IMAGE=${BUILD_IMAGE}" >> $GITHUB_ENV
84
105
for _p in `echo ${PLATFORMS} | tr ',' '\n'`; \
85
106
do \
86
- if TARGETPLATFORM="${_p}" BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io isbrokenplatform; \
107
+ if TARGETPLATFORM="${_p}" ./scripts/build/get-arch-buildargs.rtp.io isbrokenplatform; \
87
108
then \
88
109
TEST_MATRIX="${_p}${TEST_MATRIX:+,}${TEST_MATRIX}"; \
89
110
fi; \
@@ -112,7 +133,7 @@ jobs:
112
133
113
134
test_rtp_io_dock :
114
135
name : Test OpenSIPS+rtp.io
115
- needs : build_rtp_io_dock
136
+ needs : [ build_rtp_io_dock, set_env]
116
137
runs-on : ubuntu-latest
117
138
strategy :
118
139
fail-fast : false
@@ -121,13 +142,9 @@ jobs:
121
142
env :
122
143
TARGETPLATFORM : ${{ matrix.test_platform }}
123
144
BUILD_IMAGE : ${{ needs.build_rtp_io_dock.outputs.build_image }}
145
+ BUILD_OS : ${{ needs.set_env.outputs.build-os }}
124
146
125
147
steps :
126
- - name : Set dynamic environment
127
- run : |
128
- BUILD_OS="`echo ${{ inputs.rtpp-tag }} | sed 's|-.*|| ; s|_|-|g'`"
129
- echo "BUILD_OS=${BUILD_OS}" >> $GITHUB_ENV
130
-
131
148
- name : Set up QEMU
132
149
id : qemu
133
150
uses : docker/setup-qemu-action@v3
0 commit comments