-
Notifications
You must be signed in to change notification settings - Fork 12
84 lines (73 loc) · 2.43 KB
/
github-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: LKUSER CI
# Brute force build a bunch of variants of LK userspace in parallel jobs.
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain-ver: [11.2.0]
arch:
- arm
- riscv
env:
TOOLCHAIN_VER: ${{ matrix.toolchain-ver }}
ARCH: ${{ matrix.arch }}
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_VER = $TOOLCHAIN_VER
echo ARCH = $ARCH
# check out the source
- name: checkout source
uses: actions/checkout@v3
with:
submodules: true
# compute the toolchain prefix this project will need
- name: compute toolchain
shell: bash
run: |
TOOLCHAIN_PREFIX=$(make list-toolchain | grep TOOLCHAIN_PREFIX | tail -1 | cut -d ' ' -f 3)
echo "TOOLCHAIN_PREFIX=${TOOLCHAIN_PREFIX}" >> $GITHUB_ENV
echo "TOOLCHAIN=${TOOLCHAIN_PREFIX}${{ matrix.toolchain-ver }}-$(uname)-$(uname -m)" >> $GITHUB_ENV
# maintain a directory archives/ in the repo
# it will contain tarballs of various toolchains
- name: cache
uses: actions/[email protected]
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-${{ env.TOOLCHAIN }}
# download a toolchain from http://newos.org/toolchains
- name: fetch/extract toolchain
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
echo "$GITHUB_WORKSPACE/$TOOLCHAIN/bin" >> $GITHUB_PATH
# build it
- name: build
shell: bash
run: |
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