Skip to content

Commit eb76e9a

Browse files
authored
Migrate to GitHub Actions (#44)
* Migrate to GitHub Actions * Update cache restore keys to avoid conflict * Test cache * Purge cache * Add debug output * Update README.md * Update debug output * ci: refactor
1 parent d5bc576 commit eb76e9a

File tree

3 files changed

+61
-44
lines changed

3 files changed

+61
-44
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'src/drivers/**'
9+
- '.github/workflows/**'
10+
pull_request:
11+
types: [opened, synchronize]
12+
paths:
13+
- 'src/drivers/**'
14+
- '.github/workflows/**'
15+
16+
jobs:
17+
build:
18+
strategy:
19+
matrix:
20+
env:
21+
- { RPI_LINUX_VER: rpi-4.1.y, CONFIG_FILE: config-4.1.21-v7+, RPI_LINUX_COMMIT_HASH: ff45bc0 }
22+
- { RPI_LINUX_VER: rpi-4.4.y, CONFIG_FILE: config-4.4.38-v7+, RPI_LINUX_COMMIT_HASH: c95b7f1 }
23+
- { RPI_LINUX_VER: rpi-4.14.y, CONFIG_FILE: config-4.14.34-v7+, RPI_LINUX_COMMIT_HASH: f70eae4 }
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Install cross-build settings
29+
run: |
30+
mkdir -p ${HOME}/repo/raspberrypi
31+
if [ -e ${HOME}/repo/raspberrypi/tools ]; then (cd ${HOME}/repo/raspberrypi/tools && git pull); else (cd ${HOME}/repo/raspberrypi && git clone --depth 1 https://github.com/raspberrypi/tools.git); fi
32+
33+
- name: Install kernel headers
34+
env:
35+
RPI_LINUX_VER: ${{ matrix.env.RPI_LINUX_VER }}
36+
CONFIG_FILE: ${{ matrix.env.CONFIG_FILE }}
37+
RPI_LINUX_COMMIT_HASH: ${{ matrix.env.RPI_LINUX_COMMIT_HASH }}
38+
run: |
39+
if [ -e ${HOME}/repo/raspberrypi/linux ]; then (cd ${HOME}/repo/raspberrypi/linux && git fetch origin && git checkout ${RPI_LINUX_VER} && git pull); else (cd ${HOME}/repo/raspberrypi && git clone -b ${RPI_LINUX_VER} https://github.com/raspberrypi/linux.git); fi
40+
cd ${HOME}/repo/raspberrypi/linux && make clean && git reset --hard HEAD && git checkout ${RPI_LINUX_COMMIT_HASH}
41+
cp "${GITHUB_WORKSPACE}/.test/${CONFIG_FILE}" ${HOME}/repo/raspberrypi/linux/.config
42+
make CROSS_COMPILE=${HOME}/repo/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- ARCH=arm oldconfig
43+
make CROSS_COMPILE=${HOME}/repo/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- ARCH=arm -j 8
44+
45+
- name: Build kernel module
46+
run: |
47+
cd ${GITHUB_WORKSPACE}/src/drivers
48+
make -f ${GITHUB_WORKSPACE}/.test/Makefile.crosscompile
49+
50+
- name: Output kernel module info
51+
run: |
52+
uname -a
53+
echo ${{ matrix.env.RPI_LINUX_VER }} ${{ matrix.env.CONFIG_FILE }} ${{ matrix.env.RPI_LINUX_COMMIT_HASH }}
54+
cd ${GITHUB_WORKSPACE}/src/drivers
55+
modinfo rtmouse.ko
56+
57+
- name: Clean up kernel module
58+
run: |
59+
cd ${GITHUB_WORKSPACE}/src/drivers
60+
make -f ${GITHUB_WORKSPACE}/.test/Makefile.crosscompile clean

.travis.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RaspberryPiMouse
22

3-
[![Build Status](https://travis-ci.org/rt-net/RaspberryPiMouse.svg?branch=master)](https://travis-ci.org/rt-net/RaspberryPiMouse)
3+
![CI](https://github.com/rt-net/RaspberryPiMouse/workflows/CI/badge.svg?branch=master)
44

55
This repository has the source code and kernel objects
66
for the Raspberry Pi Mouse.

0 commit comments

Comments
 (0)