forked from libos-nuse/frankenlibc
-
Notifications
You must be signed in to change notification settings - Fork 5
193 lines (172 loc) · 6.23 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
push:
branches:
- master
- '**'
tags:
- 'milestone-*'
pull_request:
branches:
- master
- 'release/**'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
#
# Build/tests
#
integration:
name: test
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- displayTargetName: linux-amd64
os: linux
alias: linux
runs_on: ubuntu-24.04
arch: amd64
cc: clang
cxx: clang++
- displayTargetName: linux-arm32
os: linux
alias: linux
runs_on: ubuntu-24.04
arch: arm32
cc: arm-linux-gnueabihf-gcc
cxx: g++
- displayTargetName: linux-arm64
os: linux
alias: linux
runs_on: ubuntu-24.04
arch: arm64
cc: aarch64-linux-gnu-gcc
cxx: g++
- displayTargetName: macOS-amd64
os: macos
alias: osx
runs_on: macos-12
arch: amd64
cc: clang
cxx: clang++
timeout-minutes: 100
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
working-directory: src/frankenlibc
ARCH: ${{ matrix.arch }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
defaults:
run:
working-directory: src/frankenlibc
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: src/frankenlibc
submodules: true
- name: Set env
shell: bash
run: |
echo "/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$HOME/.local/bin:${{ github.workspace }}/bin" >> $GITHUB_PATH
echo "export PATH=/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$HOME/.local/bin:${{ github.workspace }}/bin:$PATH" >> $HOME/.bashrc
- uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.arch }}-ccache-build-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.arch }}-ccache-build-
- name: pkg dependency
run: |
pip install yamlish --break-system-packages
- name: pkg dependency (linux-amd64)
if: runner.os == 'linux' && matrix.arch == 'amd64'
run: |
sudo apt update -y
sudo apt install -y ccache
sudo ln -sf /usr/bin/ccache /usr/lib/ccache/clang
sudo ln -sf /usr/bin/ccache /usr/lib/ccache/clang++
- name: pkg dependency (linux-arm32)
if: runner.os == 'linux' && matrix.arch == 'arm32'
run: |
sudo apt-get update -y
sudo apt-get install -y crossbuild-essential-armhf ccache
- name: pkg dependency (linux-arm64)
if: runner.os == 'linux' && matrix.arch == 'arm64'
run: |
sudo apt-get update -y
sudo apt-get install -y crossbuild-essential-arm64 ccache
- name: pkg dependency (macOS)
if: runner.os == 'macos'
run: |
mkdir -p ~/.local/bin
HOMEBREW_NO_AUTO_UPDATE=1 brew install gnu-sed ccache e2fsprogs
HOMEBREW_NO_AUTO_UPDATE=1 brew install binutils coreutils jq
ln -sf /usr/local/bin/gsed ~/.local/bin/sed
ln -sf /usr/local/bin/gdate ~/.local/bin/date
ln -sf /usr/local/opt/e2fsprogs/sbin/mkfs.ext4 ~/.local/bin/
ln -sf /usr/local/opt/coreutils/bin/gcp ~/.local/bin/cp
ln -sf /usr/local/opt/binutils/bin/objcopy ~/.local/bin/objcopy
- name: clean
run: |
make distclean
- name: patch
run: |
for file in `find patches/ -maxdepth 1 -type f` ; do patch -p1 < $file ; done
for file in `find patches/${{ matrix.alias }}/ -maxdepth 1 -type f` ; do patch -p1 < $file ; done
- name: build
run: |
sudo mkdir -p /opt/rump && sudo chown -R $USER /opt/
./build.sh -j4 -d /opt/rump -q -k linux notest
- name: run tests
if: matrix.arch != 'arm32' && matrix.arch != 'arm64'
run: |
RUMPDIR=/opt/rump RUMPOBJ=`pwd`/rumpobj make -C tests run
- name: build (tiny)
run: |
KCONFIG=tinyconfig ./build.sh -j4 -d /opt/rump-tiny -o rumpobj-tiny -q -k linux notest
- name: run tests (tiny)
if: matrix.arch != 'arm32' && matrix.arch != 'arm64'
run: |
RUMPDIR=/opt/rump-tiny RUMPOBJ=`pwd`/rumpobj-tiny make -C tests run
- name: prepare assets
run: |
# for normal build
install rumpobj/tests/ping /opt/rump/bin
install rumpobj/tests/ping6 /opt/rump/bin
install rumpobj/tests/hello /opt/rump/bin
install rumpobj/tests/lkick /opt/rump/bin
tar cfz /tmp/frankenlibc-${{ matrix.arch }}-${{ matrix.alias }}.tar.gz /opt/rump/
# for tiny build
install rumpobj-tiny/tests/ping /opt/rump-tiny/bin
install rumpobj-tiny/tests/ping6 /opt/rump-tiny/bin
install rumpobj-tiny/tests/hello /opt/rump-tiny/bin
install rumpobj-tiny/tests/lkick /opt/rump-tiny/bin
tar cfz /tmp/frankenlibc-tiny-${{ matrix.arch }}-${{ matrix.alias }}.tar.gz /opt/rump-tiny/
- name: Release
if: github.ref == 'refs/heads/lkl-musl-macho'
uses: softprops/action-gh-release@v1
with:
tag_name: latest
prerelease: true
files: |
/tmp/frankenlibc-${{ matrix.arch }}-${{ matrix.alias }}.tar.gz
/tmp/frankenlibc-tiny-${{ matrix.arch }}-${{ matrix.alias }}.tar.gz
- name: ccache stat
run: |
ccache --show-stats
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Annotate
uses: yuzutech/annotations-action@v0.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
input: "${{env.working-directory}}/annotations.json"
title: "dmesg (${{ matrix.runs_on }})"