-
Notifications
You must be signed in to change notification settings - Fork 130
177 lines (164 loc) · 6.46 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Build Multi Arch
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_job:
runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
strategy:
fail-fast: false
# base_image: https://hub.docker.com
matrix:
include:
- arch: amd64
distro: debian-testing
base_image: amd64/debian:testing
packages: linux-headers-amd64
- arch: amd64
distro: debian-10-buster
base_image: amd64/debian:10
packages: linux-headers-amd64
- arch: amd64
distro: ubuntu-rolling
base_image: amd64/ubuntu:rolling
packages: linux-headers-generic
- arch: amd64
distro: ubuntu-16.04-xenial
base_image: amd64/ubuntu:16.04
packages: linux-headers-generic
- arch: amd64
distro: ubuntu-14.04-lucid
base_image: amd64/ubuntu:14.04
packages: linux-headers-generic
- arch: amd64
distro: alpine-latest
base_image: amd64/alpine:latest
packages: linux-virt-dev
#- arch: amd64
# distro: alpine-3.10
# base_image: amd64/alpine:3.10
# packages: linux-virt-dev
# - arch: amd64
# distro: centos7
# base_image: amd64/centos:7
# packages: kernel-devel
# - arch: amd64
# distro: fedora-latest
# base_image: amd64/fedora:latest
# packages: kernel-devel
# - arch: amd64
# distro: fedora-26
# base_image: amd64/fedora:26
# packages: kernel-devel
- arch: aarch64
distro: debian-testing
base_image: arm64v8/debian:testing
packages: linux-headers-arm64
- arch: aarch64
distro: debian-10-buster
base_image: arm64v8/debian:10
packages: linux-headers-arm64
- arch: aarch64
distro: ubuntu-rolling
base_image: arm64v8/ubuntu:rolling
packages: linux-headers-generic
- arch: aarch64
distro: ubuntu-16.04-xenial
base_image: arm64v8/ubuntu:16.04
packages: linux-headers-generic
- arch: aarch64
distro: ubuntu-14.04-trusty
base_image: arm64v8/ubuntu:14.04
packages: linux-headers-generic
- arch: aarch64
distro: alpine-latest
base_image: arm64v8/alpine:latest
packages: linux-virt-dev
#- arch: aarch64
# distro: alpine-3.10
# base_image: arm64v8/alpine:3.10
# packages: linux-virt-dev
# - arch: aarch64
# distro: centos7
# base_image: arm64v8/centos:7
# packages: kernel-devel
# - arch: aarch64
# distro: fedora-latest
# base_image: arm64v8/fedora:latest
# packages: kernel-devel
# - arch: aarch64
# distro: fedora-26
# base_image: arm64v8/fedora:26
# packages: kernel-devel
steps:
- uses: actions/checkout@v4
- uses: uraimo/[email protected]
name: Build
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
base_image: ${{ matrix.base_image }}
# Not required, but speeds up builds
# githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
# https://command-not-found.com/lscpu
install: |
case "${{ matrix.distro }}" in
ubuntu*|debian*|kali*)
apt-get update -q -y
apt-get install -q -y util-linux build-essential ${{ matrix.packages }}
;;
arch*)
pacman -Syu --noconfirm util-linux base-devel ${{ matrix.packages }}
;;
centos*)
yum -y update
yum -y install util-linux ${{ matrix.packages }}
yum -y groupinstall "Development Tools"
;;
fedora*)
dnf -y update
dnf -y install util-linux ${{ matrix.packages }}
dnf -y groupinstall "Development Tools"
;;
alpine*)
apk update
apk add alpine-sdk util-linux ${{ matrix.packages }}
;;
esac
# Produce a binary artifact and place it in the mounted volume
run: |
echo "--------------------------------------------------------------------------------"
cat /etc/os-release
echo "--------------------------------------------------------------------------------"
uname -a
echo "--------------------------------------------------------------------------------"
lscpu
echo "--------------------------------------------------------------------------------"
gcc -E -v - </dev/null
echo "--------------------------------------------------------------------------------"
KERNELREL=$(ls -td /lib/modules/* | head -n 1)
echo ${KERNELREL}
echo "--------------------------------------------------------------------------------"
make "KERNELREL=${KERNELREL}"
# cp $(which git) "/artifacts/${artifact_name}"
# echo "Produced artifact at /artifacts/${artifact_name}"