-
Notifications
You must be signed in to change notification settings - Fork 3
154 lines (151 loc) · 4.79 KB
/
build.yaml
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
name: Build
on:
push:
paths-ignore:
- '**/README.md'
- '.*'
branches-ignore:
- 'gh-pages'
workflow_dispatch:
jobs:
# ------------------------
prepare:
runs-on: ubuntu-latest
container:
image: hardwario/nrf-connect-sdk-build:v2.5.0-2
outputs:
short_sha: ${{ steps.short-sha.outputs.short-sha }}
samples: ${{ steps.generate-matrix.outputs.samples }}
applications: ${{ steps.generate-matrix.outputs.applications }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: 'chester-sdk/chester'
- name: cache
id: cache-chester-sdk
uses: actions/cache@v4
env:
cache-name: cache-chester-sdk
with:
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }}
restore-keys: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }}
path: |
chester-sdk/.west
chester-sdk/bootloader
chester-sdk/doxygen-awesome-css
chester-sdk/modules
chester-sdk/nrf
chester-sdk/nrfxlib
chester-sdk/test
chester-sdk/tools
chester-sdk/zephyr
- name: west init and update
if: steps.cache-chester-sdk.outputs.cache-hit != 'true'
run: |
cd chester-sdk
west init -l --mf west.yml chester
west update --narrow
west config build.board chester_nrf52840
- name: short_sha
id: short-sha
run: |
SHORT_SHA=$(git -C chester-sdk/chester rev-parse --short HEAD)
echo short-sha=${SHORT_SHA} >> $GITHUB_OUTPUT
- name: Generate Matrix
id: generate-matrix
working-directory: ./chester-sdk/chester
run: |
SAMPLES=$(python3 .github/gen-matrix.py samples)
echo $SAMPLES
echo samples=${SAMPLES} >> $GITHUB_OUTPUT
APPLICATIONS=$(python3 .github/gen-matrix.py applications)
echo $APPLICATIONS
echo applications=${APPLICATIONS} >> $GITHUB_OUTPUT
# ------------------------
build-sample:
runs-on: ubuntu-latest
container:
image: hardwario/nrf-connect-sdk-build:v2.5.0-2
needs:
- prepare
continue-on-error: true
strategy:
matrix:
sample: ${{ fromJSON(needs.prepare.outputs.samples) }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: 'chester-sdk/chester'
- name: restore cache with chester-sdk
id: cache-chester-sdk
uses: actions/cache/restore@v4
env:
cache-name: cache-chester-sdk
with:
fail-on-cache-miss: true
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }}
path: |
chester-sdk/.west
chester-sdk/bootloader
chester-sdk/doxygen-awesome-css
chester-sdk/modules
chester-sdk/nrf
chester-sdk/nrfxlib
chester-sdk/test
chester-sdk/tools
chester-sdk/zephyr
- name: build
run: |
cd chester-sdk/chester/samples/${{ matrix.sample }}
west build
# ------------------------
build-app:
runs-on: ubuntu-latest
container:
image: hardwario/nrf-connect-sdk-build:v2.5.0-2
needs:
- prepare
continue-on-error: true
strategy:
matrix:
application: ${{ fromJSON(needs.prepare.outputs.applications) }}
exclude:
- application: _legacy
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: 'chester-sdk/chester'
- name: gen build command
id: build-command
working-directory: ./chester-sdk/chester
run: |
APP_PATH=$(python3 .github/gen-applications.py ${{ matrix.application }} path)
echo $APP_PATH
echo app_path=${APP_PATH} >> $GITHUB_OUTPUT
BUILD_CMD=$(python3 .github/gen-applications.py ${{ matrix.application }} cmd)
echo $BUILD_CMD
echo build_cmd=${BUILD_CMD} >> $GITHUB_OUTPUT
- name: restore cache with chester-sdk
id: cache-chester-sdk
uses: actions/cache/restore@v4
env:
cache-name: cache-chester-sdk
with:
fail-on-cache-miss: true
key: chester-sdk-${{ hashFiles('chester-sdk/chester/west.yml') }}
path: |
chester-sdk/.west
chester-sdk/bootloader
chester-sdk/doxygen-awesome-css
chester-sdk/modules
chester-sdk/nrf
chester-sdk/nrfxlib
chester-sdk/test
chester-sdk/tools
chester-sdk/zephyr
- name: build
working-directory: ${{ steps.build-command.outputs.app_path }}
run: ${{ steps.build-command.outputs.build_cmd }}