-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22e9076
commit 81bb6c6
Showing
11 changed files
with
490 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Copyright (c) 2021 Canonical Ltd. | ||
# Copyright (c) 2023 Linaro Ltd | ||
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | ||
# <krzk@kernel.org> | ||
# | ||
# Loosely based on: https://github.com/linux-test-project/ltp | ||
# https://github.com/linux-nfc/neard | ||
# | ||
name: "Builds" | ||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
# Run at 1:01 PM, every Tuesday | ||
- cron: '1 13 * * 2' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
job: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [x86-64] | ||
family: [x86-64] | ||
compiler: [gcc, clang] | ||
container: | ||
- alpine:edge | ||
- alpine:latest | ||
- archlinux:latest | ||
- debian:testing | ||
- debian:stable | ||
- debian:bookworm | ||
- debian:bullseye | ||
- debian:buster | ||
# Fails on configure on GCC and clang (process restrictions?) | ||
# - fedora:rawhide | ||
- fedora:latest | ||
- fedora:39 | ||
- fedora:38 | ||
- fedora:37 | ||
- ubuntu:lunar # EOL 01.2024 | ||
- ubuntu:jammy | ||
- ubuntu:focal | ||
# On Ubuntu Bionic the Meson doesn't support feature options | ||
#- ubuntu:bionic | ||
# Meson version on Ubuntu Xenial is really too old | ||
#- ubuntu:xenial | ||
cross_compile: [""] | ||
variant: [""] | ||
include: | ||
# Debian 32-bit builds | ||
- container: "debian:testing" | ||
arch: i386 | ||
family: x86 | ||
compiler: gcc | ||
cross_compile: i686-linux-gnu | ||
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig | ||
variant: i386 | ||
|
||
- container: "debian:stable" | ||
arch: i386 | ||
family: x86 | ||
compiler: gcc | ||
cross_compile: i686-linux-gnu | ||
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig | ||
variant: i386 | ||
|
||
- container: "debian:bookworm" | ||
arch: i386 | ||
family: x86 | ||
compiler: gcc | ||
cross_compile: i686-linux-gnu | ||
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig | ||
variant: i386 | ||
|
||
- container: "debian:buster" | ||
arch: i386 | ||
family: x86 | ||
compiler: gcc -m32 | ||
cross_compile: i686-linux-gnu | ||
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig | ||
variant: i386 | ||
|
||
# Debian cross compilation builds | ||
- container: "debian:testing" | ||
arch: armhf | ||
family: arm | ||
compiler: arm-linux-gnueabihf-gcc | ||
cross_compile: arm-linux-gnueabihf | ||
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:testing" | ||
arch: arm64 | ||
family: aarch64 | ||
compiler: aarch64-linux-gnu-gcc | ||
cross_compile: aarch64-linux-gnu | ||
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:testing" | ||
arch: ppc64el | ||
family: ppc64 | ||
compiler: powerpc64le-linux-gnu-gcc | ||
cross_compile: powerpc64le-linux-gnu | ||
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:testing" | ||
arch: s390x | ||
family: s390x | ||
compiler: s390x-linux-gnu-gcc | ||
cross_compile: s390x-linux-gnu | ||
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:stable" | ||
arch: armhf | ||
family: arm | ||
compiler: arm-linux-gnueabihf-gcc | ||
cross_compile: arm-linux-gnueabihf | ||
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:stable" | ||
arch: arm64 | ||
family: aarch64 | ||
compiler: aarch64-linux-gnu-gcc | ||
cross_compile: aarch64-linux-gnu | ||
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:stable" | ||
arch: ppc64el | ||
family: ppc64 | ||
compiler: powerpc64le-linux-gnu-gcc | ||
cross_compile: powerpc64le-linux-gnu | ||
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
- container: "debian:stable" | ||
arch: s390x | ||
family: s390x | ||
compiler: s390x-linux-gnu-gcc | ||
cross_compile: s390x-linux-gnu | ||
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig | ||
variant: cross-compile | ||
|
||
container: | ||
image: ${{ matrix.container }} | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
FAMILY: ${{ matrix.family }} | ||
CC: ${{ matrix.compiler }} | ||
CROSS_COMPILE: ${{ matrix.cross_compile }} | ||
PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }} | ||
VARIANT: ${{ matrix.variant }} | ||
|
||
steps: | ||
- name: Show OS | ||
run: cat /etc/os-release | ||
|
||
- name: Show env (matrix settings) | ||
run: | | ||
echo "ARCH: $ARCH" | ||
echo "FAMILY: $FAMILY" | ||
echo "CC: $CC" | ||
echo "CROSS_COMPILE: $CROSS_COMPILE" | ||
echo "VARIANT: $VARIANT" | ||
echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH" | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install additional packages | ||
run: | | ||
INSTALL=${{ matrix.container }} | ||
INSTALL="${INSTALL%%:*}" | ||
INSTALL="${INSTALL%%/*}" | ||
./ci/$INSTALL.sh | ||
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi | ||
- name: Compiler version | ||
run: $CC --version | ||
|
||
- name: Display environment and Linux version | ||
run: | | ||
test -f /etc/issue && cat /etc/issue | ||
echo "############################################" | ||
lsb_release -a || true | ||
echo "############################################" | ||
cat /usr/include/linux/version.h | ||
echo "############################################" | ||
uname -a | ||
echo "############################################" | ||
cat /proc/cmdline | ||
echo "############################################" | ||
printenv | ||
# i386 build on x86_64 only requires passing -m32 to CFLAGS & LDFLAGS | ||
- name: Meson init for i386 | ||
if: ${{ matrix.variant == 'i386' }} | ||
run: | | ||
mkdir build | ||
CFLAGS="-m32" LDFLAGS="-m32" meson setup --errorlogs --werror . build | ||
- name: Meson init with cross compile | ||
if: ${{ matrix.variant == 'cross-compile' }} | ||
run: | | ||
# Generate cross compile file (see https://mesonbuild.com/Cross-compilation.html#cross-compilation) | ||
echo "[binaries]" > cross.txt | ||
echo "c = '${CROSS_COMPILE}-gcc'" >> cross.txt | ||
echo "strip = '${CROSS_COMPILE}-strip'" >> cross.txt | ||
# Forcing pkgconfig binary to 'pkg-config' is required for cross build to work | ||
echo "pkgconfig = 'pkg-config'" >> cross.txt | ||
echo "[host_machine]" >> cross.txt | ||
echo "system = 'linux'" >> cross.txt | ||
echo "cpu_family = '${FAMILY}'" >> cross.txt | ||
echo "cpu = '${ARCH}'" >> cross.txt | ||
echo "endian = 'little'" >> cross.txt | ||
echo "[properties]" >> cross.txt | ||
echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt | ||
cat cross.txt | ||
mkdir build | ||
meson setup --errorlogs --werror --cross-file cross.txt . build | ||
- name: Meson init | ||
if: ${{ matrix.variant == '' }} | ||
run: | | ||
mkdir build | ||
meson setup --errorlogs --werror . build | ||
- name: Compile | ||
run: ninja -C build | ||
|
||
- name: Install | ||
run: ninja -C build install |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Copyright (c) 2021 Canonical Ltd. | ||
# Copyright (c) 2023 Linaro Ltd | ||
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | ||
# <krzk@kernel.org> | ||
# | ||
name: "CodeQL" | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Install additional packages | ||
run: sudo ./ci/ubuntu.sh | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Copyright (c) 2021 Canonical Ltd. | ||
# Copyright (c) 2023 Linaro Ltd | ||
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | ||
# <krzk@kernel.org> | ||
# | ||
# Loosely based on: https://github.com/linux-test-project/ltp | ||
# https://github.com/linux-nfc/neard | ||
# | ||
name: "Yaml" | ||
on: | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
job: | ||
name: Yaml | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
container: | ||
image: ubuntu:jammy | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install additional packages | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true | ||
apt update | ||
apt install -y --no-install-recommends yamllint python3-jsonschema python3-ruamel.yaml | ||
- name: Lint samples | ||
run: for file in config-samples/*; do yamllint $file; done | ||
|
||
- name: Check samples | ||
run: for file in config-samples/*; do python3 ./validate.py -s schema.yaml $file; done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Copyright (c) 2021 Canonical Ltd. | ||
# Copyright (c) 2023 Linaro Ltd | ||
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | ||
# <krzk@kernel.org> | ||
# | ||
|
||
set -ex | ||
|
||
PKGS_CC="gcc" | ||
case $CC in | ||
clang*) | ||
PKGS_CC="clang" | ||
;; | ||
esac | ||
|
||
apk add \ | ||
linux-headers \ | ||
meson \ | ||
musl-dev \ | ||
libc-dev \ | ||
$PKGS_CC | ||
|
||
echo "Install finished: $0" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Copyright (c) 2021 Canonical Ltd. | ||
# Copyright (c) 2023 Linaro Ltd | ||
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | ||
# <krzk@kernel.org> | ||
# | ||
|
||
set -ex | ||
|
||
PKGS_CC="gcc" | ||
case $CC in | ||
clang*) | ||
PKGS_CC="clang" | ||
;; | ||
esac | ||
|
||
pacman -Syu --noconfirm \ | ||
systemd-libs \ | ||
pkgconf \ | ||
meson \ | ||
$PKGS_CC | ||
|
||
echo "Install finished: $0" |
Oops, something went wrong.