Merge pull request #798 from CGarces/github_actions

Migrate travis CI to github actions
This commit is contained in:
Christian Bremvåg 2020-12-23 15:09:26 +01:00 committed by GitHub
commit 5521bf9e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 66 deletions

53
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Build
on: [push, pull_request]
jobs:
fetchKernelData:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
JSON=$(curl https://www.kernel.org/releases.json)
VERSIONSARRAY=$(echo $JSON | jq -c '[.releases[] | {version: .version, moniker: .moniker} | select(.moniker != "linux-next") | .version]')
echo ::set-output name=matrix::${VERSIONSARRAY}
build:
needs: fetchKernelData
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{fromJson(needs.fetchKernelData.outputs.matrix)}}
#version: [4.9.248, 4.4.248]
include:
#Version 4.15.x requested to test Ubuntu 18.04 LTS version
- os: ubuntu-18.04
version: 4.15.0-20-generic
use_apt: true
steps:
- uses: actions/checkout@v2
- name: download-Kernel
env:
VERSION: ${{matrix.version }}
if: ${{ !matrix.use_apt }}
run: |
KERNEL_URL=https://kernel.ubuntu.com/~kernel-ppa/mainline/
KERNEL_URL_DETAILS=$(wget --quiet -O - ${KERNEL_URL}v${VERSION}/ | grep -A8 "Build for amd64\|Test amd64")
ALL_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 'all.deb' | cut -d '"' -f 2)
KVER=$(echo $ALL_DEB | cut -d '_' -f 2 | rev | cut -c14- | rev)-generic
wget ${KERNEL_URL}v${VERSION}/$(echo "$KERNEL_URL_DETAILS" | grep -m1 "amd64.deb" | cut -d '"' -f 2)
wget ${KERNEL_URL}v${VERSION}/$ALL_DEB
sudo dpkg --force-all -i *.deb
sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/module.lds.S -O /usr/src/linux-headers-$KVER/scripts/module.lds
sudo sed -i '$ d' /usr/src/linux-headers-$KVER/scripts/module.lds
echo "KVER=$KVER" >> $GITHUB_ENV
- name: apt-linux-headers
if: ${{ matrix.use_apt }}
run: |
sudo apt-get install linux-headers-${{matrix.version }}
echo "KVER=${{matrix.version }}" >> $GITHUB_ENV
- name: build
run: make KVER=$KVER

View File

@ -1,66 +0,0 @@
language: c
compiler: gcc
dist: bionic
os: linux
before_install:
- export KERNEL_URL_DETAILS=$(wget --quiet -O - ${KERNEL_URL}v${KVER}/ | grep -A8 'Build for amd64\|Test amd64')
- export ALL_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 'all.deb' | cut -d '"' -f 2)
- export KVER_BUILD=$(echo $ALL_DEB | cut -d '_' -f 2 | rev | cut -c14- | rev)
- wget ${KERNEL_URL}v${KVER}/$(echo "$KERNEL_URL_DETAILS" | grep -m1 'amd64.deb' | cut -d '"' -f 2)
- wget ${KERNEL_URL}v${KVER}/$ALL_DEB
- sudo dpkg -i *.deb
script:
- make CC=$COMPILER KVER=$KVER_BUILD-generic
env:
global:
- KERNEL_URL=https://kernel.ubuntu.com/~kernel-ppa/mainline/
addons:
apt:
packages:
#Force update to GCC-7.5 in order to compile Kernels >= 5.4.
- gcc-7
cache:
- ccache: true
jobs:
include:
- addons:
apt:
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
packages:
- gcc-10
env: COMPILER=gcc-10 KVER=$(curl -s https://www.kernel.org/releases.json | grep 'mainline' -B1 | head -1 | cut -d'"' -f4)
- addons:
apt:
packages:
- gcc-9
env: COMPILER=gcc-9 KVER=$(curl -s https://www.kernel.org/releases.json | grep 'mainline' -B1 | head -1 | cut -d'"' -f4)
- addons:
apt:
packages:
- gcc-8
env: COMPILER=gcc-8 KVER=$(curl -s https://www.kernel.org/releases.json | grep 'mainline' -B1 | head -1 | cut -d'"' -f4)
- env: COMPILER=gcc-7 KVER=$(curl -s https://www.kernel.org/releases.json | grep 'mainline' -B1 | head -1 | cut -d'"' -f4)
- env: COMPILER=gcc-7 KVER=$(curl -s https://www.kernel.org/releases.json | grep -A1 'latest_stable' | tail -1 | cut -d'"' -f4)
#Kernels 5.4 with minor versions > 28 are failing on amd64. Not upgrade the minor version without check https://kernel.ubuntu.com/~kernel-ppa/mainline/
- env: COMPILER=gcc-7 KVER=5.4.28
- env: COMPILER=gcc-7 KVER=4.19.116
- env: COMPILER=gcc-7 KVER=4.14.176
- env: COMPILER=gcc-7 KVER=4.9.219
- env: COMPILER=gcc-7 KVER=4.4.219
#Version 4.15.x requested to test Ubuntu 18.04 LTS version
#TODO identify 4.15.x version dynamically instead of hardcode it.
- addons:
apt:
packages:
- linux-headers-4.15.0-20-generic
#Use the kernel headers from apt instead of download it from an external source
before_install: true
env: COMPILER=gcc-7 $KVER_BUILD=4.15.0-20