-
Notifications
You must be signed in to change notification settings - Fork 1.1k
204 lines (170 loc) · 5.48 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
194
195
196
197
198
199
200
201
202
203
204
# CI jobs
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch: # temporary for testing
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# Weekly build to make sure dependencies are OK
- cron: '30 16 * * 1'
permissions:
contents: read
jobs:
cache_docker_image:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
id: cache-docker-layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Pull Docker image
run: docker pull bitcraze/builder
- name: Save Docker image to cache
run: docker save bitcraze/builder -o /tmp/.buildx-cache/bitcraze-builder.tar
read_targets_from_file:
uses: bitcraze/workflows/.github/workflows/read_build_targets.yml@cc82f0e5999c39eff964dd73ce9363e94d5b5b76
with:
target_file: './build_targets.json'
basic_build:
needs: [cache_docker_image, read_targets_from_file]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
${{fromJson(needs.read_targets_from_file.outputs.platforms)}}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Restore Docker image from cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Load Docker image
run: docker load -i /tmp/.buildx-cache/bitcraze-builder.tar
- name: build
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make ${{ matrix.platform }}_defconfig && ./tools/build/build UNIT_TEST_STYLE=min"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}.bin
build/${{ matrix.platform }}.elf
features:
runs-on: ubuntu-latest
needs: basic_build
strategy:
fail-fast: false
matrix:
features:
# Build cf2 with bosch sensors
- bosch.conf
# Build cf2 with TDMA
- loco_tdma.conf
# Build cf2 with TDOA2 positioning mode
- loco_tdoa2.conf
#- LPS_TDOA_ENABLE=1
# Build cf2 with TDOA3 positioning mode
- loco_tdoa3.conf
#- LPS_TDOA3_ENABLE=1
# Build cf2 with TDOA3 and all config options
- loco_tdoa3_all.conf
# Build Bigquad deck with all config options
- bigquad.conf
# Build API test app layer app
- app_api.conf
env:
CONF: ${{ matrix.features }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Restore Docker image from cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Load Docker image
run: docker load -i /tmp/.buildx-cache/bitcraze-builder.tar
- name: build
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "./scripts/kconfig/merge_config.sh configs/${CONF} configs/defconfig && ./tools/build/build UNIT_TEST_STYLE=min"
apps:
runs-on: ubuntu-latest
needs: basic_build
strategy:
fail-fast: false
matrix:
example:
- examples/app_hello_world
- examples/app_hello_world-cpp
- examples/app_hello_file_tree
- examples/app_peer_to_peer
- examples/app_p2p_DTR
- examples/app_stm_gap8_cpx
- examples/demos/app_push_demo
- examples/demos/swarm_demo
- examples/demos/app_wall_following_demo
env:
EXAMPLE: ${{ matrix.example }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Restore Docker image from cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Load Docker image
run: docker load -i /tmp/.buildx-cache/bitcraze-builder.tar
- name: build
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "./tools/build/make_app ${EXAMPLE}"
kbuild-targets:
runs-on: ubuntu-latest
needs: basic_build
strategy:
fail-fast: false
matrix:
target:
- allyesconfig
- allnoconfig
- randconfig
env:
TARGET: ${{ matrix.target }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Restore Docker image from cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Load Docker image
run: docker load -i /tmp/.buildx-cache/bitcraze-builder.tar
- name: build
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "KCONFIG_ALLCONFIG=configs/all.config make ${TARGET} && ./tools/build/build UNIT_TEST_STYLE=min"