diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 2b182f36..57ccb855 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -11,6 +11,8 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* name: Bazel Build (Linux) +permissions: + contents: read on: pull_request: types: [opened, reopened, synchronize] @@ -22,7 +24,27 @@ on: workflow_call: jobs: linux-build-and-test: - runs-on: ubuntu-latest + name: Build and Test ${{ matrix.bazel-config }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + include: + - bazel-config: bl-x86_64-linux + bazel-build-target: "//score/..." + bazel-test-target: >- + //score/... + -//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test + bazel-test-extra-flags: "" + - bazel-config: bl-aarch64-linux + bazel-build-target: "//score/..." + bazel-test-target: >- + //score/... + -//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test + -//score/os/test:acl_test + -//score/os/test:errno_test + -//score/os/test:socket_test + bazel-test-extra-flags: "--test_timeout=180,900,2700,10800" # Increase test timeout due to QEMU emulation steps: - name: Checkout Repository uses: actions/checkout@v6 @@ -30,14 +52,23 @@ jobs: uses: bazel-contrib/setup-bazel@0.18.0 with: bazelisk-cache: true - disk-cache: ${{ github.job }} + disk-cache: ${{ github.job }}_${{ matrix.bazel-config }} repository-cache: true cache-save: ${{ github.event_name == 'push' }} + - name: Install QEMU + if: matrix.bazel-config == 'bl-aarch64-linux' + run: | + sudo apt-get update + sudo apt install -y qemu-user - name: Bazel Build run: | - bazel build --config bl-x86_64-linux -- //score/... + bazel build --config ${{ matrix.bazel-config }} -- ${{ matrix.bazel-build-target }} - name: Bazel Test run: | - bazel test --config bl-x86_64-linux -- //score/... \ - -//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test \ - -//score/containers:dynamic_array_test + bazel test --config ${{ matrix.bazel-config }} ${{ matrix.bazel-test-extra-flags }} -- ${{ matrix.bazel-test-target }} + - name: Upload test logs on failure + if: failure() + uses: actions/upload-artifact@v7 + with: + name: bazel-testlogs-${{ matrix.bazel-config }} + path: bazel-testlogs/**/test.log diff --git a/.yamlfmt b/.yamlfmt index 4e708adf..28a583c8 100644 --- a/.yamlfmt +++ b/.yamlfmt @@ -1,2 +1,5 @@ exclude: - score/language/futurecpp/.clang-format +formatter: + type: basic + scan_folded_as_literal: true diff --git a/README.md b/README.md index 17835a0f..6ea88d0d 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,10 @@ Use the same command as for x86_64 Linux, but replace `--config=bl-x86_64-linux` When cross-compiling for AArch64, test binaries cannot run natively on an x86_64 host. They are executed locally using [QEMU user-mode emulation](https://www.qemu.org/docs/master/user/main.html). -**Prerequisite:** Install the `qemu-user-static` package on your host system: +**Prerequisite:** Install the `qemu-user` package on your host system: ```bash -sudo apt install qemu-user-static # Debian/Ubuntu +sudo apt install qemu-user # Debian/Ubuntu ``` Verify the installation: diff --git a/qemu.bzl b/qemu.bzl index 7072ca76..40b8bb0f 100644 --- a/qemu.bzl +++ b/qemu.bzl @@ -25,7 +25,7 @@ locate the target architecture's shared libraries at runtime. Prerequisites: The QEMU user-mode emulator for the target architecture must be installed on the host system and available on $PATH. For example, to emulate aarch64 - binaries on Debian/Ubuntu, install the ``qemu-user-static`` package. + binaries on Debian/Ubuntu, install the ``qemu-user`` package. """ load("@rules_cc//cc/common:cc_common.bzl", "cc_common")