forked from linux-automation/meta-lxatac
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (71 loc) · 2.54 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
name: build
on:
pull_request:
branches:
- styhead
push:
branches:
- styhead
schedule:
- cron: '10 21 * * 4'
jobs:
build:
name: build
runs-on: [self-hosted, forrest, build]
if: ${{ vars.HAS_BUILD_RUNNER || github.repository == 'linux-automation/meta-lxatac' }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build bundle and images
run: |
# oe-init-build-env implicitly cd-s into the build directory.
source oe-init-build-env build
# Apply default config provided by our custom runner images
cp ~/.yocto/auto.conf conf/
# Build all images that are relevant to us.
bitbake \
lxatac-core-image-base \
lxatac-core-bundle-base \
lxatac-debug-image \
emmc-image \
emmc-boot-image \
tf-a-stm32mp
# Make the generates images available at a less deeply nested
# location for the artifact upload (the directory structure is
# preserved in the archive).
# Keep in mind that we are in the `build` directory because
# `oe-init-build-env` implicitly `cd`s there.
mv tmp/deploy/images/lxatac ../images
- name: Print logs of failed jobs
if: ${{ failure() }}
shell: python3 {0}
run: |
import os
PREFIX = 'ERROR: Logfile of failure stored in:'
for ln in open('build/tmp/log/cooker/lxatac/console-latest.log'):
if not ln.startswith(PREFIX):
continue
path = ln.removeprefix(PREFIX).strip()
shorter_path = path.removeprefix(os.getcwd()).strip('/')
print(f'::group::Contents of "{shorter_path}"')
print(open(path).read())
print('::endgroup::')
- name: Cache Data
env:
CACHE_KEY: ${{ secrets.YOCTO_CACHE_KEY }}
if: ${{ github.ref_protected && env.CACHE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$CACHE_KEY" >> ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
rsync -rvx --ignore-existing build/downloads yocto-cache: || true
rsync -rvx --ignore-existing build/sstate-cache yocto-cache: || true
- name: Upload RAUC Bundle
uses: actions/upload-artifact@v4
with:
name: rauc-bundle
path: images/lxatac-core-bundle-base-lxatac-*.raucb
compression-level: 0
retention-days: 30