[github][actions] Add a new action to build LK, replacing travis-ci

Use the new github actions to replace the travis-ci builders which
seem to no longer work and are being removed.

This first stab is fairly rough, just matches the explicit matrix
that was in the travis-ci hooks, but at least gets back to a buildable
state again.
This commit is contained in:
Travis Geiselbrecht
2021-02-14 14:38:49 -08:00
parent 7b0ca3c984
commit b730a5ef5c
3 changed files with 166 additions and 103 deletions

166
.github/workflows/github-ci.yml vendored Normal file
View File

@@ -0,0 +1,166 @@
name: LK CI
# Brute force build a bunch of variants of LK in parallel jobs.
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# build a bunch of common projects with debuglevel 2
- project: qemu-virt-arm32-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: qemu-virt-arm64-test
toolchain: aarch64-elf-7.5.0-Linux-x86_64
debug: 2
- project: qemu-virt-arm32-minimal
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: vim2-test
toolchain: aarch64-elf-7.5.0-Linux-x86_64
debug: 2
- project: zybo-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: rpi2-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: uzed-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: stm32746g-eval2-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: stm32f429i-disco-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: stm32f746g-disco-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: stm32f4-discovery-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: stellaris-launchpad-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: nrf51-pca10028-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: nucleo-f072rb
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 2
- project: qemu-microblaze-test
toolchain: microblaze-elf-7.5.0-Linux-x86_64
debug: 2
- project: qemu-mips-test
toolchain: mips-elf-7.5.0-Linux-x86_64
debug: 2
- project: qemu-virt-riscv32-test
toolchain: riscv32-elf-7.5.0-Linux-x86_64
debug: 2
- project: qemu-virt-riscv64-test
toolchain: riscv64-elf-7.5.0-Linux-x86_64
debug: 2
- project: qemu-virt-riscv64-supervisor-test
toolchain: riscv64-elf-7.5.0-Linux-x86_64
debug: 2
- project: sifive-e-test
toolchain: riscv32-elf-7.5.0-Linux-x86_64
debug: 2
- project: sifive-unleashed-test
toolchain: riscv64-elf-7.5.0-Linux-x86_64
debug: 2
- project: pc-x86-test
toolchain: i386-elf-7.5.0-Linux-x86_64
debug: 2
- project: pc-x86-64-test
toolchain: x86_64-elf-7.5.0-Linux-x86_64
debug: 2
# build some in release mode (DEBUG=0)
- project: qemu-virt-arm32-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 0
- project: qemu-virt-arm64-test
toolchain: aarch64-elf-7.5.0-Linux-x86_64
debug: 0
- project: stm32f746g-disco-test
toolchain: arm-eabi-7.5.0-Linux-x86_64
debug: 0
- project: pc-x86-test
toolchain: i386-elf-7.5.0-Linux-x86_64
debug: 0
- project: pc-x86-64-test
toolchain: x86_64-elf-7.5.0-Linux-x86_64
debug: 0
- project: qemu-microblaze-test
toolchain: microblaze-elf-7.5.0-Linux-x86_64
debug: 0
- project: qemu-mips-test
toolchain: mips-elf-7.5.0-Linux-x86_64
debug: 0
- project: sifive-e-test
toolchain: riscv32-elf-7.5.0-Linux-x86_64
debug: 0
env:
PROJECT: ${{ matrix.project }}
TOOLCHAIN: ${{ matrix.toolchain }}
DEBUG: ${{ matrix.debug }}
steps:
- name: banner
shell: bash
run: |
printf "Building with %d processors\n" "$(nproc)"
grep -oP '(?<=model name\t: ).*' /proc/cpuinfo|head -n1
echo PROJECT = $PROJECT
echo TOOLCHAIN = $TOOLCHAIN
echo DEBUG = $DEBUG
# check out the source
- uses: actions/checkout@v2
# maintain a directory archives/ in the repo
# it will contain tarballs of various toolchains
- name: cache
uses: actions/cache@v2.1.1
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: archives
# An explicit key for restoring and saving the cache
key: archives-${{ matrix.toolchain }}-${{ runner.os }}
# download a toolchain from http://newos.org/toolchains
- name: toolchains
shell: bash
run: |
TOOLCHAIN_BASE_URL="http://newos.org/toolchains"
TOOLCHAIN_SUFFIX="tar.xz"
TOOLCHAIN_ADDRESS="$TOOLCHAIN_BASE_URL/$TOOLCHAIN.$TOOLCHAIN_SUFFIX"
mkdir -p archives
cd archives
echo "Downloading toolchain $TOOLCHAIN from $TOOLCHAIN_ADDRESS"
wget -v -N $TOOLCHAIN_ADDRESS || exit 1
cd ..
echo "Unpacking $TOOLCHAIN"
tar xf archives/$TOOLCHAIN.$TOOLCHAIN_SUFFIX || exit 1
# build it
- name: build
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/$TOOLCHAIN/bin:$PATH
make -j $(nproc)
# upload artifacts
#- uses: actions/upload-artifact@v2
# with:
# name: build-dir
# path: build-${{ matrix.project }}/lk.*
# vim: ts=2 sw=2 expandtab

View File

@@ -1,56 +0,0 @@
language: c
script: ./scripts/travis-build.sh
env:
- PROJECT=qemu-virt-arm32-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=qemu-virt-arm64-test TOOLCHAIN=aarch64-elf-7.5.0-Linux-x86_64
- PROJECT=qemu-virt-arm32-minimal TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=vim2-test TOOLCHAIN=aarch64-elf-7.5.0-Linux-x86_64
- PROJECT=zybo-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=rpi2-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=uzed-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=stm32746g-eval2-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=stm32f429i-disco-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=stm32f746g-disco-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=stm32f4-discovery-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=stellaris-launchpad-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=nrf51-pca10028-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=nucleo-f072rb TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64
- PROJECT=qemu-microblaze-test TOOLCHAIN=microblaze-elf-7.5.0-Linux-x86_64
- PROJECT=qemu-mips-test TOOLCHAIN=mips-elf-7.5.0-Linux-x86_64
- PROJECT=qemu-virt-riscv32-test TOOLCHAIN=riscv32-elf-7.5.0-Linux-x86_64
- PROJECT=qemu-virt-riscv64-test TOOLCHAIN=riscv64-elf-7.5.0-Linux-x86_64
- PROJECT=qemu-virt-riscv64-supervisor-test TOOLCHAIN=riscv64-elf-7.5.0-Linux-x86_64
- PROJECT=sifive-e-test TOOLCHAIN=riscv32-elf-7.5.0-Linux-x86_64
- PROJECT=sifive-unleashed-test TOOLCHAIN=riscv64-elf-7.5.0-Linux-x86_64
- PROJECT=pc-x86-test TOOLCHAIN=i386-elf-7.5.0-Linux-x86_64
- PROJECT=pc-x86-64-test TOOLCHAIN=x86_64-elf-7.5.0-Linux-x86_64
# do one build with an older toolchain
- PROJECT=qemu-virt-arm32-test TOOLCHAIN=arm-eabi-5.3.0-Linux-x86_64
- PROJECT=qemu-virt-arm32-test TOOLCHAIN=arm-eabi-4.8.2-Linux-x86_64
# a few release mode builds
- PROJECT=qemu-virt-arm32-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=qemu-virt-arm64-test TOOLCHAIN=aarch64-elf-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=stm32f746g-disco-test TOOLCHAIN=arm-eabi-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=pc-x86-test TOOLCHAIN=i386-elf-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=pc-x86-64-test TOOLCHAIN=x86_64-elf-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=qemu-microblaze-test TOOLCHAIN=microblaze-elf-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=qemu-mips-test TOOLCHAIN=mips-elf-7.5.0-Linux-x86_64 DEBUG=0
- PROJECT=sifive-e-test TOOLCHAIN=riscv32-elf-7.5.0-Linux-x86_64 DEBUG=0
# build environment is linux xenial
os: linux
dist: xenial
arch: amd64
# try to cache the toolchain download
cache:
directories:
- archives
# notify a few irc channels
notifications:
irc:
channels:
- "chat.freenode.net#lk"

View File

@@ -1,47 +0,0 @@
#!/bin/sh
# Copyright (c) 2014 Eren Türkay <turkay.eren@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# This is a script for travis-ci that builds lk for different
# architectures using different toolchains on travis-ci build machine.
#
# PROJECT and TOOLCHAIN are provided as environment variables. These
# variables are specified in .travis.yml file.
TOOLCHAIN_BASE_URL="http://newos.org/toolchains"
TOOLCHAIN_SUFFIX="tar.xz"
TOOLCHAIN_ADDRESS="$TOOLCHAIN_BASE_URL/$TOOLCHAIN.$TOOLCHAIN_SUFFIX"
mkdir -p archives
cd archives
echo "Downloading toolchain $TOOLCHAIN from $TOOLCHAIN_ADDRESS"
wget -v -N $TOOLCHAIN_ADDRESS || exit 1
cd ..
echo "Unpacking $TOOLCHAIN"
tar xf archives/$TOOLCHAIN.$TOOLCHAIN_SUFFIX || exit 1
export PATH=`pwd`/$TOOLCHAIN/bin:$PATH
echo "Starting build '$PROJECT' with '$TOOLCHAIN'\n"
./scripts/make-parallel $PROJECT