-
Notifications
You must be signed in to change notification settings - Fork 27
96 lines (88 loc) · 3.45 KB
/
CI_github.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
name: meta-mono
on:
push:
branches:
- master
- master-next
- scarthgap
pull_request:
jobs:
build-and-test:
runs-on: [self-hosted, linux, X64]
timeout-minutes: 600
container:
image: dynamicdevices/yocto-ci-build:latest
options: --privileged --platform linux/amd64 -v /dev/net/tun:/dev/net/tun -v /dev/kvm:/dev/kvm
strategy:
matrix:
dotnet_version: [8.0.303, 6.0.424]
mono_version: [6.12.0.182]
branch: [scarthgap]
arch: [x86-64, arm, arm64]
env:
name: build-and-test
MONO_VERSION: ${{ matrix.mono_version }}
DOTNET_VERSION: ${{ matrix.dotnet_version }}
ARCH: ${{ matrix.arch }}
BRANCH: ${{ matrix.branch }}
steps:
- name: Checkout meta-mono
uses: actions/checkout@v4
with:
clean: false
path: ${{ matrix.branch }}/meta-mono
- name: Update repo poky
run: |
if [ ! -d ${BRANCH}/poky ]; then
git clone git://git.yoctoproject.org/poky -b ${BRANCH} ${BRANCH}/poky
else
cd ${BRANCH}/poky
git pull origin ${BRANCH}
cd ../..
fi
- name: Update repo meta-openembedded
run: |
if [ ! -d ${BRANCH}/meta-openembedded ]; then
git clone https://github.com/openembedded/meta-openembedded.git -b ${BRANCH} ${BRANCH}/meta-openembedded
else
cd ${BRANCH}/meta-openembedded
git pull origin ${BRANCH}
cd ../..
fi
- name: Configuring
run: |
rm -f ${BRANCH}/build/conf/local.conf
rm -f ${BRANCH}/build/conf/bblayers.conf
. ./${BRANCH}/poky/oe-init-build-env ${BRANCH}/build
# Append custom variables for regenerated local.conf and bblayers.conf samples
echo "### Starting to configure local.conf and bblayers.conf ###"
echo "mono version: $MONO_VERSION"
echo "dotnet version: $DOTNET_VERSION"
echo "BBLAYERS += '$GITHUB_WORKSPACE/${BRANCH}/meta-mono'" >> conf/bblayers.conf
echo "BBLAYERS += '$GITHUB_WORKSPACE/${BRANCH}/meta-openembedded/meta-oe'" >> conf/bblayers.conf
echo "MACHINE=\"qemu${ARCH}\"" >> conf/local.conf
echo "DL_DIR=\"$GITHUB_WORKSPACE/downloads\"" >> conf/local.conf
echo "PREFERRED_VERSION_mono=\"${MONO_VERSION}\"" >> conf/local.conf
echo "PREFERRED_VERSION_mono-native=\"${MONO_VERSION}\"" >> conf/local.conf
echo "PREFERRED_VERSION_dotnet=\"${DOTNET_VERSION}\"" >> conf/local.conf
echo "PREFERRED_VERSION_dotnet-native=\"${DOTNET_VERSION}\"" >> conf/local.conf
echo "INHERIT += \" rm_work \"" >> conf/local.conf
sed -i 's/#IMAGE_CLASSES += "testimage testsdk"/IMAGE_CLASSES += "testimage "/' conf/local.conf
- name: Cleaning
run: |
. ./${BRANCH}/poky/oe-init-build-env ${BRANCH}/build
bitbake -c cleanall test-image-mono dotnet dotnet-native
- name: Building
run: |
. ./${BRANCH}/poky/oe-init-build-env ${BRANCH}/build
bitbake -k test-image-mono
- name: Testing
run: |
. ./${BRANCH}/poky/oe-init-build-env ${BRANCH}/build
export TERM=linux
bitbake test-image-mono -c testimage
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: test-image-mono-${{ matrix.branch }}-${{ matrix.mono_version }}-${{ matrix.dotnet_version }}-${{ github.sha }}-${{ matrix.arch }}
path: ./${{ matrix.branch }}/build/tmp/deploy/images/qemu${{ matrix.arch }}/