Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: Bazel Build (Linux)
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
Expand All @@ -22,22 +24,51 @@ 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
- name: Setup Bazel
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
3 changes: 3 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
exclude:
- score/language/futurecpp/.clang-format
formatter:
type: basic
scan_folded_as_literal: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion qemu.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading