Skip to content

[aarch64] Gate PMU paths on per-CPU PMUSERENR_EL0 sampled each hrtime… #629

[aarch64] Gate PMU paths on per-CPU PMUSERENR_EL0 sampled each hrtime…

[aarch64] Gate PMU paths on per-CPU PMUSERENR_EL0 sampled each hrtime… #629

Workflow file for this run

name: Build Multi Arch
on:
push:
# GitHub-Actions tab
workflow_dispatch:
jobs:
build_job:
runs-on: ubuntu-22.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
distro: debian-testing
base_image: amd64/debian:testing
packages: linux-headers-amd64
- arch: amd64
distro: ubuntu-rolling
base_image: amd64/ubuntu:rolling
packages: linux-headers-generic
- arch: amd64
distro: ubuntu-16.04-xenial
base_image: amd64/ubuntu:16.04
packages: linux-headers-generic
- arch: amd64
distro: ubuntu-14.04-lucid
base_image: amd64/ubuntu:14.04
packages: linux-headers-generic
- arch: amd64
distro: alpine-latest
base_image: amd64/alpine:latest
packages: linux-virt-dev
- arch: aarch64
distro: ubuntu-16.04-xenial
base_image: arm64v8/ubuntu:16.04
packages: linux-headers-generic
- arch: aarch64
distro: ubuntu-14.04-trusty
base_image: arm64v8/ubuntu:14.04
packages: linux-headers-generic
- arch: riscv64
distro: debian-testing
base_image: debian:testing
packages: linux-headers-generic
use_run_on_arch_action: "false"
- arch: ppc64le
distro: debian-testing
base_image: debian:testing
packages: linux-headers-generic
use_run_on_arch_action: "false"
steps:
- uses: actions/checkout@v4
# === START: riscv64/ppc64le ===
- name: Set up QEMU (binfmt) for cross-arch containers
if: matrix.use_run_on_arch_action == 'false'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
if: matrix.use_run_on_arch_action == 'false'
uses: docker/setup-buildx-action@v3
- name: Build (riscv64/ppc64le via docker --platform)
if: matrix.use_run_on_arch_action == 'false'
env:
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
run: |
set -eux
mkdir -p "${PWD}/artifacts"
case "${{ matrix.arch }}" in
riscv64) DOCKER_ARCH=riscv64 ;;
ppc64le) DOCKER_ARCH=ppc64le ;;
*) echo "Unexpected arch for docker --platform path: ${{ matrix.arch }}"; exit 1 ;;
esac
docker run --rm --platform "linux/${DOCKER_ARCH}" \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/artifacts:/artifacts" \
--workdir "${PWD}" \
-e artifact_name="${artifact_name}" \
"${{ matrix.base_image }}" \
/bin/sh -lc '
echo "--------------------------------------------------------------------------------"
cat /etc/os-release
echo "--------------------------------------------------------------------------------"
uname -a
echo "--------------------------------------------------------------------------------"
lscpu || true
echo "--------------------------------------------------------------------------------"
gcc -E -v - </dev/null || true
echo "--------------------------------------------------------------------------------"
apt-get update -q -y
apt-get install -q -y util-linux build-essential ${{ matrix.packages }}
KERNELREL=$(ls -td /lib/modules/* 2>/dev/null | head -n 1 || true)
echo "${KERNELREL}"
echo "--------------------------------------------------------------------------------"
make "KERNELREL=${KERNELREL}"
'
# === END: riscv64/ppc64le ===
# === START: amd64/aarch64 path (existing run-on-arch-action) ====
- uses: uraimo/run-on-arch-action@v3
name: Build
id: build
if: matrix.use_run_on_arch_action != 'false'
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
base_image: ${{ matrix.base_image }}
# Not required, but speeds up builds
# githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
# https://command-not-found.com/lscpu
install: |
case "${{ matrix.distro }}" in
ubuntu*|debian*|kali*)
apt-get update -q -y
apt-get install -q -y util-linux build-essential ${{ matrix.packages }}
;;
arch*)
pacman -Syu --noconfirm util-linux base-devel ${{ matrix.packages }}
;;
centos*)
yum -y update
yum -y install util-linux ${{ matrix.packages }}
yum -y groupinstall "Development Tools"
;;
fedora*)
dnf -y update
dnf -y install util-linux ${{ matrix.packages }}
dnf -y groupinstall "Development Tools"
;;
alpine*)
apk update
apk add alpine-sdk util-linux ${{ matrix.packages }}
;;
esac
# Produce a binary artifact and place it in the mounted volume
run: |
echo "--------------------------------------------------------------------------------"
cat /etc/os-release
echo "--------------------------------------------------------------------------------"
uname -a
echo "--------------------------------------------------------------------------------"
lscpu
echo "--------------------------------------------------------------------------------"
gcc -E -v - </dev/null
echo "--------------------------------------------------------------------------------"
KERNELREL=$(ls -td /lib/modules/* | head -n 1)
echo ${KERNELREL}
echo "--------------------------------------------------------------------------------"
make "KERNELREL=${KERNELREL}"
# cp $(which git) "/artifacts/${artifact_name}"
# echo "Produced artifact at /artifacts/${artifact_name}"
# === END: amd64/aarch64 path (existing run-on-arch-action) ===