rtmouse.cの分割(リファクタリング) #143
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/driver-cross-build.yml' | |
- '.test/**' | |
- 'src/drivers/**' | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- '.github/workflows/driver-cross-build.yml' | |
- '.test/**' | |
- 'src/drivers/**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Lint | |
run: | | |
./.test/lint.sh | |
build: | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
# Debian 10 (Buster) | |
- { HOST: 20.04, KERNEL_VER: rpi-5.4.y, OS_BIT: armhf, RASPI: 3} | |
- { HOST: 20.04, KERNEL_VER: rpi-5.4.y, OS_BIT: armhf, RASPI: 4} | |
# Debian 11 (Bullseye) | |
- { HOST: 20.04, KERNEL_VER: rpi-5.10.y, OS_BIT: armhf, RASPI: 3} | |
- { HOST: 20.04, KERNEL_VER: rpi-5.10.y, OS_BIT: armhf, RASPI: 4} | |
# Debian 11 (Bullseye) | |
- { HOST: 22.04, KERNEL_VER: rpi-5.15.y, OS_BIT: armhf, RASPI: 3} | |
- { HOST: 22.04, KERNEL_VER: rpi-5.15.y, OS_BIT: armhf, RASPI: 4} | |
# Debian 12 (Bookworm) 32-bit | |
- { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: armhf, RASPI: 3} | |
- { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: armhf, RASPI: 4} | |
# Debian 12 (Bookworm) 64-bit | |
- { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: arm64, RASPI: 3} | |
- { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: arm64, RASPI: 4} | |
runs-on: ubuntu-${{ matrix.env.HOST }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Set up cross-compilation toolchain | |
run: | | |
sudo apt update | |
sudo apt install -y bc bison flex libssl-dev make libc6-dev libncurses5-dev | |
if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then | |
sudo apt install -y crossbuild-essential-armhf | |
else | |
sudo apt install -y crossbuild-essential-arm64 | |
fi | |
- name: Clone Raspberry Pi Linux Kernel | |
run: | | |
git clone --branch ${{ matrix.env.KERNEL_VER }} --depth=1 https://github.com/raspberrypi/linux | |
cd linux | |
if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then | |
if [ "${{ matrix.env.RASPI }}" == "3" ]; then | |
KERNEL=kernel7 | |
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig | |
elif [ "${{ matrix.env.RASPI }}" == "4" ]; then | |
KERNEL=kernel7l | |
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig | |
fi | |
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare | |
else | |
KERNEL=kernel8 | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_prepare | |
fi | |
- name: Build the kernel module | |
run: | | |
cd linux | |
if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then | |
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- M=$GITHUB_WORKSPACE/src/drivers V=1 KBUILD_MODPOST_WARN=1 modules | |
else | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- M=$GITHUB_WORKSPACE/src/drivers V=1 KBUILD_MODPOST_WARN=1 modules | |
fi |