forked from managarm/managarm
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (112 loc) · 4.24 KB
/
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
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
name: CI
on: [push, pull_request]
jobs:
build-package:
strategy:
matrix:
include:
- pkg: managarm-kernel
tool_deps: >-
cross-binutils
host-llvm-toolchain
host-managarm-tools
host-protoc
kernel-gcc
system-gcc
pkg_deps: >-
mlibc
mlibc-headers
- pkg: managarm-system
tool_deps: >-
cross-binutils
host-autoconf-v2.69
host-automake-v1.11
host-automake-v1.15
host-libtool
host-llvm-toolchain
host-managarm-tools
host-pkg-config
host-protoc
host-xorg-macros
system-gcc
pkg_deps: >-
boost
eudev
mlibc
mlibc-headers
protobuf
name: Build ${{ matrix.pkg }}
runs-on: ubuntu-20.04
steps:
- name: Install prerequisites
run: |
set -x
sudo apt-get update
sudo apt-get install qemu-system-x86
pip3 install xbstrap
xbstrap prereqs cbuildrt xbps
- name: Checkout bootstrap-managarm
uses: actions/checkout@v2
with:
repository: managarm/bootstrap-managarm
path: src/
- name: Checkout Managarm
uses: actions/checkout@v2
with:
path: src/managarm/
fetch-depth: 0
- name: Download rootfs
run: |
set -x
curl -o rootfs.tar.gz https://repos.managarm.org/buildenv/managarm-buildenv.tar.gz
tar -xzf rootfs.tar.gz
- name: Prepare src/ and build/
run: |
set -x
touch src/managarm/checkedout.xbstrap
mkdir build/
cat << EOF > build/bootstrap-site.yml
define_options:
arch: x86_64
arch-triple: x86_64-managarm
pkg_management:
format: xbps
container:
runtime: cbuildrt
rootfs: ../rootfs
uid: 1000
gid: 1000
src_mount: /var/lib/managarm-buildenv/src
build_mount: /var/lib/managarm-buildenv/build
allow_containerless: true
EOF
- name: Build ${{ matrix.pkg }} package
run: |
set -x
xbstrap init ../src
xbstrap download-tool-archive $CI_TOOL_DEPS
xbstrap pull-pack $CI_PKG_DEPS
xbstrap pack $CI_BUILD_PKG
env:
CI_BUILD_PKG: ${{ matrix.pkg }}
CI_TOOL_DEPS: ${{ matrix.tool_deps }}
CI_PKG_DEPS: ${{ matrix.pkg_deps }}
working-directory: build/
- name: Generate image
run: |
set -x
curl -o image.xz https://builds.managarm.org/repos/files/managarm/latest/image.xz
unxz image.xz
../src/scripts/update-image.py -m loopback mount
# For now we need root because the mount point is owned by root
# and xbps uses access(mountpoint/, W_OK) to test if it can write.
sudo --preserve-env=XBPS_ARCH ~/.xbstrap/bin/xbps-install -fy -R xbps-repo/ -r mountpoint/ $CI_BUILD_PKG
../src/scripts/update-image.py unmount
env:
CI_BUILD_PKG: ${{ matrix.pkg }}
XBPS_ARCH: x86_64
working-directory: build/
- name: Test ${{ matrix.pkg }} package
run: |
../src/scripts/test-image.py
working-directory: build/