ATfL Nightly Build and Test #113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |