-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (66 loc) · 2.33 KB
/
build.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
name: Bob the Builder
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
name: Build ${{ matrix.platform }} ${{ matrix.profile }}
runs-on: ubuntu-latest
strategy:
matrix:
profile: [app, os]
platform: [basis, coronet, dagger, envoy, ember, zero]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set Build Variables
id: vars
run: |
export NETBOX_TUPLE=${{ matrix.profile }}-${{ matrix.platform }}
echo ::set-output name=dir::netbox-${NETBOX_TUPLE}
echo ::set-output name=tgz::netbox-${NETBOX_TUPLE}.tar.gz
- name: Restore Cache of dl/
uses: actions/cache@v2
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ matrix.profile }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.profile }}-
dl-${{ matrix.platform }}-os-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v2
with:
path: .buildroot-ccache/
key: ccache-${{ matrix.board }}-os-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.board }}-os-
ccache-${{ matrix.board }}-
ccache--os-
- name: Configure & Build
run: |
make netbox_${{ matrix.profile }}_${{ matrix.platform }}_defconfig
make
- name: Prepare Artifact
# The tarball helps retain file modes and gives us a containing
# directory, something the upload-artifact does not support.
# Downside, we get a zip with a tar.gz on download
run: |
cd output
rm -rf images/syslinux
if [ -f images/qemu.cfg ]; then
sed -i 's,/home/runner/work/netbox/netbox/output/images/,,g' images/qemu.cfg
cp ../utils/qemu images/
fi
mv images ${{ steps.vars.outputs.dir }}
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.vars.outputs.tgz }}
path: output/${{ steps.vars.outputs.tgz }}