-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathatfl_nightly_build_and_test.yml
More file actions
146 lines (121 loc) · 4.9 KB
/
Copy pathatfl_nightly_build_and_test.yml
File metadata and controls
146 lines (121 loc) · 4.9 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
# Copyright (c) 2026, Arm Limited and affiliates.
# Part of the Arm Toolchain project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# This workflow builds Docker images for multiple operating systems and runs
# the Linux build script inside each image.
# It is intended to be triggered as part of a **nightly build** to
# validate all build configurations and test them automatically.
#
# Each Docker image and build script pair runs as a separate matrix job,
# allowing for concurrency and clear traceability of failures.
name: ATfL Nightly Build and Test
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # Every day at 06:00 UTC
# GitHub queues the second run until the first one finishes,
# preventing overlapping executions.
concurrency:
group: atfl-nightly-build
cancel-in-progress: false
jobs:
build-and-test-toolchain:
name: Build ${{ matrix.build_script }} in ${{ matrix.image_name }}
runs-on: ah-ubuntu_24_04-c7g_8x-100
timeout-minutes: 240
env:
ATFL_VERSION: "0.0"
# Allow manual runs on Fork for testing, and
# scheduled runs only on arm/arm-toolchain
if: github.event_name == 'workflow_dispatch' || github.repository == 'arm/arm-toolchain'
strategy:
fail-fast: false # Prevents one job failure from cancelling all
matrix:
include:
# Ubuntu Build & Test
- build_script: build.sh
target_os: Ubuntu-24.04-arm64
dockerfile: Dockerfile_ubuntu2404
image_name: ubuntu2404_docker
# RHEL10 Build & Test
- build_script: build.sh
target_os: RHEL10-arm64
dockerfile: Dockerfile_rhel10
image_name: rhel10_docker
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Clean previous artifacts
run: rm -rf arm-software/linux/output arm-software/linux/build arm-software/linux/logs
- name: Mark workspace as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build Docker image
shell: bash
run: |
set -euo pipefail
docker build \
--file "arm-software/linux/scripts/Docker_Files/${{ matrix.dockerfile }}" \
--tag "${{ matrix.image_name }}" \
--build-arg USER_ID="$(id -u)" \
--build-arg GROUP_ID="$(id -g)" \
arm-software/linux/scripts/Docker_Files
- name: Run build.sh in Docker image
shell: bash
run: |
set -euo pipefail
docker run --rm \
--volume "$GITHUB_WORKSPACE:/workspace/src" \
--workdir /workspace \
"${{ matrix.image_name }}" \
bash -lc '
set -euo pipefail
git config --global --add safe.directory /workspace/src
if [[ "${{ matrix.target_os }}" == RHEL10-* ]]; then
export ZLIB_STATIC_PATH=/usr/lib64/libz.a
fi
./src/arm-software/linux/${{ matrix.build_script }}
' 2>&1 | tee build-${{ matrix.target_os }}.log
- name: List built artifacts
if: ${{ success() }}
shell: bash
run: |
set -euo pipefail
if [[ -d arm-software/linux/output ]]; then
find arm-software/linux/output -maxdepth 3 -type f \( -name '*.tar.gz' \) | sort
fi
- name: Upload build log and test reports
uses: actions/upload-artifact@v7
if: ${{ always() && !env.ACT }}
with:
name: build-log-${{ matrix.target_os }}
path: |
build-${{ matrix.target_os }}.log
arm-software/linux/logs/bootstrap_check_all.xml
arm-software/linux/logs/check_cxx.xml
arm-software/linux/logs/check_cxxabi.xml
arm-software/linux/logs/product_check_all.xml
if-no-files-found: warn
- name: Get tarball name
if: ${{ success() && !env.ACT }}
id: tarball
shell: bash
run: |
set -euo pipefail
path=$(find arm-software/linux/output -maxdepth 1 -type f -name 'atfl-*.tar.gz')
test "$(printf '%s\n' "$path" | wc -l)" -eq 1
filename=$(basename "$path")
date=$(date -u +%Y%m%d)
# Strip .tar.gz, append OS and date, then add extension back.
artifact_name="${filename%.tar.gz}-${{ matrix.target_os }}-${date}.tar.gz"
echo "name=$artifact_name" >> "$GITHUB_OUTPUT"
echo "path=$path" >> "$GITHUB_OUTPUT"
- name: Upload tarball
uses: actions/upload-artifact@v7
if: ${{ success() && !env.ACT }}
with:
name: ${{ steps.tarball.outputs.name }}
path: ${{ steps.tarball.outputs.path }}
if-no-files-found: error