-
Notifications
You must be signed in to change notification settings - Fork 3.3k
315 lines (295 loc) · 10.7 KB
/
Copy pathmaint-27.yaml
File metadata and controls
315 lines (295 loc) · 10.7 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
## %CopyrightBegin%
##
## SPDX-License-Identifier: Apache-2.0
##
## Copyright Ericsson AB 2024-2026. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## %CopyrightEnd%
name: Build and check Erlang/OTP 27 (reusable)
on:
workflow_call:
secrets:
TRIGGER_ERLANG_ORG_BUILD:
description: 'Token to trigger erlang.org rebuild'
required: false
## concurrency and env cannot be set in a reusable workflow called via workflow_call;
## they must be set in the caller workflow.
permissions:
contents: read
jobs:
setup:
uses: ./.github/workflows/reusable-setup.yaml
## no 'with:' needed - reusable-setup derives everything from github context
pack:
name: Build Erlang/OTP (64-bit)
needs: setup
permissions:
contents: read
actions: write
uses: ./.github/workflows/reusable-pack.yaml
with:
base_branch: ${{ needs.setup.outputs.base_branch }}
full_build_and_check: ${{ needs.setup.outputs.full_build_and_check }}
bypass_erlang_repo: false
build-macos:
name: Build Erlang/OTP (macOS)
needs: pack
permissions:
contents: read
actions: write
if: needs.pack.outputs.build-c-code == 'true'
uses: ./.github/workflows/reusable-build-macos.yaml
with:
base_branch: ${{ needs.pack.outputs.base_branch }}
build-ios:
name: Build Erlang/OTP (iOS)
needs: pack
if: needs.pack.outputs.build-c-code == 'true'
permissions:
contents: read
actions: write
uses: ./.github/workflows/reusable-build-ios.yaml
with:
base_branch: ${{ needs.pack.outputs.base_branch }}
build-windows:
name: Build Erlang/OTP (Windows)
needs: pack
if: needs.pack.outputs.build-c-code == 'true'
permissions:
contents: read
actions: writ
uses: ./.github/workflows/reusable-build-windows.yaml
with:
base_branch: ${{ needs.pack.outputs.base_branch }}
build-flavors:
name: Build Erlang/OTP (Types and Flavors)
runs-on: ubuntu-latest
needs: pack
if: needs.pack.outputs.c-code-changes
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/build-base-image
with:
BASE_BRANCH: ${{ env.BASE_BRANCH }}
- name: Build Erlang/OTP flavors and types
run: |
TYPES="opt debug lcnt"
FLAVORS="emu jit"
for TYPE in ${TYPES}; do
for FLAVOR in ${FLAVORS}; do
echo "::group::{TYPE=$TYPE FLAVOR=$FLAVOR}"
docker run otp "make TYPE=$TYPE FLAVOR=$FLAVOR"
echo "::endgroup::"
done
done
build:
name: Build Erlang/OTP
needs:
- pack
if: needs.pack.outputs.build-c-code == 'true'
permissions:
contents: read
uses: ./.github/workflows/reusable-build-otp.yaml
with:
base_branch: ${{ needs.setup.outputs.base_branch }}
# keep documentation before overhaul (OTP-27)
documentation:
name: Build and check documentation
runs-on: ubuntu-latest
needs:
- setup
- pack
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/build-base-image
with:
## BASE_BRANCH env var is not available here; compute inline
BASE_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
## Build all the documentation
- name: Build documentation
env:
BASE_URL: ${{ github.event_name == 'pull_request' &&
format('{0}/blob/{1}/',github.event.pull_request.head.repo.full_name,github.event.pull_request.head.ref) ||
format('{0}/blob/{1}/',github.repository,github.ref_name)
}}
run: |
docker build --build-arg BASE_URL="$BASE_URL" -t otp - <<EOF
FROM otp
ENV BASE_URL=$BASE_URL
RUN ./otp_build download_ex_doc
RUN make release docs release_docs && sudo make install-docs
EOF
- name: Release docs to publish
run: .github/scripts/release-docs.sh
- name: Upload html documentation archive
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: otp_doc_html
path: otp_doc_html.tar.gz
- name: Upload man documentation archive
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: otp_doc_man
path: otp_doc_man.tar.gz
- name: Trigger rebuild of erlang.org/docs/
if: github.ref_name == 'master' && github.repository == 'erlang/otp'
env:
GITHUB_TOKEN: ${{ secrets.TRIGGER_ERLANG_ORG_BUILD }}
run: |
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/erlang/erlang-org/actions/workflows/update-gh-cache.yaml/dispatches" -d '{"ref":"master"}'
- name: Run html link check
run: docker run -v $PWD/:/github otp "cd /github/docs && /github/scripts/otp_check_html_links.exs"
static:
name: Run static analysis
runs-on: ubuntu-latest
needs:
- setup
- pack
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/build-base-image
with:
BASE_BRANCH: ${{ env.BASE_BRANCH }}
- name: Install clang-format
run: |
docker build -t otp - <<EOF
FROM otp
RUN sudo apt-get install -y clang-format
EOF
## Check formatting of cpp code
- name: Check format
run: docker run otp "make format-check"
## Run dialyzer
- name: Run dialyzer
run: docker run -v $PWD/:/github otp '/github/scripts/run-dialyzer'
# different way to build make prevents us from using reusable-test.
test:
name: Test Erlang/OTP
runs-on: ubuntu-latest
needs: pack
if: needs.pack.outputs.changes != '[]'
permissions:
contents: read
actions: write
strategy:
matrix:
type: ${{ fromJson(needs.pack.outputs.changes) }}
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/build-base-image
with:
## BASE_BRANCH env var is not available here; compute inline
BASE_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
- name: Run tests
id: run-tests
env:
MATRIX_TYPE: ${{ matrix.type }}
run: |
set -x
mkdir $PWD/make_test_dir
APP="${MATRIX_TYPE}"
## Need to specialize for epmd, emulator and debug
case "${APP}" in
emulator) DIR=erts/emulator/ ;;
epmd) DIR=erts/epmd ;;
debug) DIR=lib/os_mon; APP=os_mon; TYPE=debug ;;
*) DIR=lib/${MATRIX_TYPE} ;;
esac
## Remove systemd-coredump
! sudo apt remove systemd-coredump
## Removing systemd-coredump, caused apport to be installed instead, so we disable it
! sudo service apport stop
sudo bash -c "echo 'core.%p' > /proc/sys/kernel/core_pattern"
docker run --ulimit core=-1 --ulimit nofile=5000:5000 --pids-limit 1024 \
-e CTRUN_TIMEOUT=90 -e SPEC_POSTFIX=gh \
-e TEST_NEEDS_RELEASE=true -e "RELEASE_ROOT=/buildroot/otp/Erlang ∅⊤ℝ" \
-e EXTRA_ARGS="-ct_hooks cth_surefire [{path,\"/buildroot/otp/$DIR/make_test_dir/${MATRIX_TYPE}_junit.xml\"}]" \
-v "$PWD/make_test_dir:/buildroot/otp/$DIR/make_test_dir" \
-v "$PWD/scripts:/buildroot/otp/scripts" \
otp "make TYPE=${TYPE} && make ${APP}_test TYPE=${TYPE}"
## Rename os_mon to debug for debug build
if [ "$APP" != "${MATRIX_TYPE}" ]; then
mv make_test_dir/${APP}_test "make_test_dir/${MATRIX_TYPE}_test"
fi
- name: Cleanup tests
if: ${{ !cancelled() }}
env:
MATRIX_TYPE: ${{ matrix.type }}
run: |
rm -rf make_test_dir/otp || true
sudo bash -c "chown -R `whoami` make_test_dir && chmod -R +r make_test_dir"
tar czf ${MATRIX_TYPE}_test_results.tar.gz make_test_dir
- name: Upload test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ !cancelled() }}
with:
name: ${{ matrix.type }}_test_results
path: ${{ matrix.type }}_test_results.tar.gz
system-test:
name: Test Erlang/OTP (system)
if: ${{ !cancelled() && needs.pack.result == 'success' }} # Run even if the need has failed
permissions:
contents: read
actions: write
needs:
- pack
- test
uses: ./.github/workflows/reusable-system-test.yaml
with:
base_branch: ${{ needs.pack.outputs.base_branch }}
## If this is an "OTP-*" tag that has been pushed, create a release
release:
name: Release Erlang/OTP
needs:
- setup
- documentation
permissions:
contents: write
attestations: write
id-token: write
actions: write
if: startsWith(github.ref, 'refs/tags/OTP-') && github.repository == 'erlang/otp'
uses: ./.github/workflows/reusable-release.yaml
with:
otp_branch: ${{ needs.setup.outputs.otp_version }}
otp_sbom_version: ''
tag: ${{ needs.setup.outputs.tag }}
vsn: ${{ needs.setup.outputs.vsn }}
secrets:
TRIGGER_ERLANG_ORG_BUILD: ${{ secrets.TRIGGER_ERLANG_ORG_BUILD }}
# GITHUB_TOKEN is already available in called workflow.
event_file:
name: "Event File"
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Upload
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Event File
path: ${{ github.event_path }}