Merge pull request #29099 from medhefgo/ci

ci: Misc improvements
This commit is contained in:
Luca Boccassi
2023-09-06 11:11:51 +01:00
committed by GitHub
8 changed files with 27 additions and 28 deletions

View File

@@ -68,8 +68,6 @@ LINKER="${LINKER:?}"
CRYPTOLIB="${CRYPTOLIB:?}"
RELEASE="$(lsb_release -cs)"
bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ $RELEASE main restricted universe multiverse' >>/etc/apt/sources.list"
# Note: As we use postfixed clang/gcc binaries, we need to override $AR
# as well, otherwise meson falls back to ar from binutils which
# doesn't work with LTO
@@ -79,12 +77,13 @@ if [[ "$COMPILER" == clang ]]; then
AR="llvm-ar-$COMPILER_VERSION"
# Prefer the distro version if available
if ! apt install --dry-run "llvm-$COMPILER_VERSION" >/dev/null; then
if ! apt-get -y install --dry-run "llvm-$COMPILER_VERSION" >/dev/null; then
# Latest LLVM stack deb packages provided by https://apt.llvm.org/
# Following snippet was partly borrowed from https://apt.llvm.org/llvm.sh
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --yes --dearmor --output /usr/share/keyrings/apt-llvm-org.gpg
printf "deb [signed-by=/usr/share/keyrings/apt-llvm-org.gpg] http://apt.llvm.org/%s/ llvm-toolchain-%s-%s main\n" \
"$RELEASE" "$RELEASE" "$COMPILER_VERSION" >/etc/apt/sources.list.d/llvm-toolchain.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | \
sudo gpg --yes --dearmor --output /usr/share/keyrings/apt-llvm-org.gpg
echo "deb [signed-by=/usr/share/keyrings/apt-llvm-org.gpg] http://apt.llvm.org/$RELEASE/ llvm-toolchain-$RELEASE-$COMPILER_VERSION main" | \
sudo tee /etc/apt/sources.list.d/llvm-toolchain.list
fi
PACKAGES+=("clang-$COMPILER_VERSION" "lldb-$COMPILER_VERSION" "python3-lldb-$COMPILER_VERSION" "lld-$COMPILER_VERSION" "clangd-$COMPILER_VERSION")
@@ -93,10 +92,10 @@ elif [[ "$COMPILER" == gcc ]]; then
CXX="g++-$COMPILER_VERSION"
AR="gcc-ar-$COMPILER_VERSION"
if ! apt install --dry-run "gcc-$COMPILER_VERSION" >/dev/null; then
if ! apt-get -y install --dry-run "gcc-$COMPILER_VERSION" >/dev/null; then
# Latest gcc stack deb packages provided by
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo add-apt-repository -y --no-update ppa:ubuntu-toolchain-r/test
fi
PACKAGES+=("gcc-$COMPILER_VERSION" "gcc-$COMPILER_VERSION-multilib")
@@ -105,10 +104,11 @@ else
fi
# PPA with some newer build dependencies (like zstd)
add-apt-repository -y ppa:upstream-systemd-ci/systemd-ci
apt-get -y update
apt-get -y build-dep systemd
apt-get -y install "${PACKAGES[@]}"
sudo add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci
sudo add-apt-repository -y --no-update --enable-source
sudo apt-get -y update
sudo apt-get -y build-dep systemd
sudo apt-get -y install "${PACKAGES[@]}"
# Install more or less recent meson and ninja with pip, since the distro versions don't
# always support all the features we need (like --optimization=). Since the build-dep
# command above installs the distro versions, let's install the pip ones just
@@ -139,7 +139,7 @@ for args in "${ARGS[@]}"; do
CXX="$CXX" CXX_LD="$LD" CXXFLAGS="-Werror" \
meson setup \
-Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true --werror \
-Dnobody-group=nogroup -Dcryptolib="${CRYPTOLIB:?}" \
-Dnobody-group=nogroup -Dcryptolib="${CRYPTOLIB:?}" -Ddebug=false \
$args build; then
cat build/meson-logs/meson-log.txt

View File

@@ -34,5 +34,5 @@ jobs:
steps:
- name: Repository checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: ${{ format('Build check ({0}-{1}-{2}-{3})', env.COMPILER, env.COMPILER_VERSION, env.LINKER, env.CRYPTOLIB) }}
run: sudo -E .github/workflows/build_test.sh
- name: Build check
run: .github/workflows/build_test.sh

View File

@@ -23,13 +23,13 @@ jobs:
matrix:
sanitizer: [address, undefined, memory]
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
- name: Build Fuzzers
id: build
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
with:
sanitizer: ${{ matrix.sanitizer }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
- name: Run Fuzzers
id: run
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
with:

View File

@@ -39,7 +39,7 @@ jobs:
security-events: write
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
@@ -51,7 +51,7 @@ jobs:
sanitizer: ${{ matrix.sanitizer }}
architecture: ${{ matrix.architecture }}
output-sarif: true
- name: Run Fuzzers (${{ matrix.sanitizer }})
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'systemd'

View File

@@ -140,14 +140,14 @@ jobs:
- name: Generate secure boot key
run: mkosi --debug genkey
- name: Show ${{ matrix.distro }} image summary
- name: Show image summary
run: mkosi summary
- name: Build ${{ matrix.distro }}
- name: Build
run: mkosi --debug
- name: Boot ${{ matrix.distro }} systemd-nspawn
- name: Boot systemd-nspawn
run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
- name: Boot ${{ matrix.distro }} QEMU
- name: Boot QEMU
run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123

View File

@@ -3,7 +3,6 @@
# shellcheck disable=SC2206
PHASES=(${@:-SETUP RUN RUN_ASAN_UBSAN CLEANUP})
RELEASE="$(lsb_release -cs)"
ADDITIONAL_DEPS=(
clang
expect
@@ -46,9 +45,9 @@ for phase in "${PHASES[@]}"; do
case $phase in
SETUP)
info "Setup phase"
bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ $RELEASE main restricted universe multiverse' >>/etc/apt/sources.list"
# PPA with some newer build dependencies
add-apt-repository -y ppa:upstream-systemd-ci/systemd-ci
add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci
add-apt-repository -y --no-update --enable-source
apt-get -y update
apt-get -y build-dep systemd
apt-get -y install "${ADDITIONAL_DEPS[@]}"

View File

@@ -39,7 +39,7 @@ jobs:
# Pass only specific env variables through sudo, to avoid having
# the already existing XDG_* stuff on the "other side"
sudo --preserve-env=CRYPTOLIB,GITHUB_ACTIONS,CI .github/workflows/unit_tests.sh SETUP
- name: Build & test (${{ matrix.run_phase }}-${{ matrix.cryptolib }})
- name: Build & test
run: sudo --preserve-env=CRYPTOLIB,GITHUB_ACTIONS,CI .github/workflows/unit_tests.sh RUN_${{ matrix.run_phase }}
env:
CRYPTOLIB: ${{ matrix.cryptolib }}

View File

@@ -191,7 +191,7 @@ the PR (set by the $UPSTREAM_PULL_REQUEST env variable) you'd like to debug:
Now install necessary build & test dependencies:
## PPA with some newer Ubuntu packages required by upstream systemd
# add-apt-repository -y ppa:upstream-systemd-ci/systemd-ci
# add-apt-repository -y --enable-source ppa:upstream-systemd-ci/systemd-ci
# apt build-dep -y systemd
# apt install -y autopkgtest debhelper genisoimage git qemu-system-x86