Files
i2c-imc-skylake/.github/workflows/ci.yml
T
Simone 5f97a71ad2 ci: fix the two Clang jobs after runner image drift
Both Clang jobs broke without the driver changing. GCC passed everywhere it
actually compiles: out-of-tree, in-tree x86_64, checkpatch and shellcheck.

The out-of-tree LLVM=1 job never reached this source. The runner now ships
6.17.0-1020-azure headers built with GCC, and their Makefiles pass flags
clang rejects outright:

  clang: error: unknown argument: '-fconserve-stack'
  clang: error: unsupported argument 'bounds-strict' to option '-fsanitize='
  clang: error: unsupported option '-mrecord-mcount'

Building a module with a different compiler than the kernel it links against
is not something to paper over, and it was testing nothing useful: the
meaningful Clang coverage is the in-tree job, which controls the whole
build. Drop Clang from the out-of-tree job and say why in a comment.

The in-tree arm64 job failed at defconfig with "linker 'ld.lld' not found".
LLVM=1 wants the whole LLVM toolchain and ld.lld ships in its own package,
which the runner no longer pulls in as a dependency of llvm. Install lld.

Since the out-of-tree job no longer needs a matrix, its steps lose the
per-compiler conditionals and shellcheck moves into the dependency install
rather than being fetched mid-job.
2026-07-27 00:12:58 +02:00

139 lines
4.6 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
I2C_TREE: https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git
SPARSE_REPOSITORY: https://git.kernel.org/pub/scm/devel/sparse/sparse.git
SPARSE_COMMIT: 00c4b8e75cbf92003bc4a695a223045092b173f3
jobs:
out-of-tree:
name: Out-of-tree build
runs-on: ubuntu-latest
timeout-minutes: 30
# GCC only, deliberately. Building a module with LLVM=1 against the
# runner's distro headers fails before it reaches this source: those
# headers were built with GCC and their Makefiles pass flags clang does
# not accept (-fconserve-stack, -fsanitize=bounds-strict, -mrecord-mcount).
# Clang coverage belongs in the in-tree job below, which controls the
# whole kernel build.
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential linux-headers-$(uname -r) shellcheck
- name: Build module
run: make W=1 KCFLAGS=-W
- name: Run checkpatch
run: make checkpatch
- name: Check shell scripts
run: |
bash -n test-smoke.sh
for f in tools/*.sh; do bash -n "$f"; done
shellcheck -S warning test-smoke.sh tools/*.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: i2c-imc-skylake-${{ github.ref_name }}
path: i2c-imc-skylake.ko
if-no-files-found: error
in-tree:
name: Current i2c-host integration
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install kernel build dependencies
run: |
sudo apt-get update
sudo apt-get install -y bc bison build-essential clang flex libelf-dev \
libssl-dev lld llvm
- name: Build pinned Sparse
run: |
git clone --filter=blob:none "$SPARSE_REPOSITORY" sparse
git -C sparse checkout "$SPARSE_COMMIT"
make -C sparse -j"$(nproc)"
echo "$PWD/sparse" >> "$GITHUB_PATH"
- name: Prepare current maintainer tree
run: |
git clone --depth=1 --branch i2c/i2c-host "$I2C_TREE" linux-i2c
cp i2c-imc-skylake.c linux-i2c/drivers/i2c/busses/
cat docs/submission/Kconfig.kernel >> linux-i2c/drivers/i2c/busses/Kconfig
printf '%s\n' 'obj-$(CONFIG_I2C_IMC_SKYLAKE) += i2c-imc-skylake.o' \
>> linux-i2c/drivers/i2c/busses/Makefile
git -C linux-i2c rev-parse HEAD
- name: Configure kernel
working-directory: linux-i2c
run: |
make O=../linux-out x86_64_defconfig
scripts/config --file ../linux-out/.config --enable I2C --module I2C_IMC_SKYLAKE
make O=../linux-out olddefconfig
grep '^CONFIG_I2C_IMC_SKYLAKE=m' ../linux-out/.config
- name: Build driver in-tree
working-directory: linux-i2c
run: make O=../linux-out W=1 drivers/i2c/busses/i2c-imc-skylake.o
- name: Build arm64 COMPILE_TEST with Clang
working-directory: linux-i2c
run: |
make O=../linux-out-arm64 ARCH=arm64 LLVM=1 defconfig
scripts/config --file ../linux-out-arm64/.config \
--enable COMPILE_TEST --enable PCI --enable I2C \
--module I2C_IMC_SKYLAKE
make O=../linux-out-arm64 ARCH=arm64 LLVM=1 olddefconfig
grep '^CONFIG_I2C_IMC_SKYLAKE=m' ../linux-out-arm64/.config
make O=../linux-out-arm64 ARCH=arm64 LLVM=1 W=1 \
drivers/i2c/busses/i2c-imc-skylake.o
- name: Run Sparse in-tree
working-directory: linux-i2c
run: |
make O=../linux-out C=2 CF=-D__CHECK_ENDIAN__ \
drivers/i2c/busses/i2c-imc-skylake.o
- name: Run current-tree checkpatch
working-directory: linux-i2c
run: |
scripts/checkpatch.pl --strict --no-tree -f \
drivers/i2c/busses/i2c-imc-skylake.c
- name: Build the documentation
working-directory: linux-i2c
run: |
sudo apt-get install -y python3-sphinx python3-sphinx-rtd-theme
cp ../docs/submission/i2c-imc-skylake.rst Documentation/i2c/busses/
sed -i 's|^ i2c-i801$| i2c-i801\n i2c-imc-skylake|' \
Documentation/i2c/busses/index.rst
grep -q i2c-imc-skylake Documentation/i2c/busses/index.rst
make O=../linux-out htmldocs SPHINXDIRS=i2c 2>&1 | tee doc.log | tail -20
! grep -Ei 'WARNING|ERROR' doc.log