-
Notifications
You must be signed in to change notification settings - Fork 1.3k
177 lines (151 loc) · 4.78 KB
/
Copy pathCI.yml
File metadata and controls
177 lines (151 loc) · 4.78 KB
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
# 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:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# Weekly build to make sure dependencies are OK
- cron: '30 16 * * 1'
workflow_dispatch:
permissions:
contents: read
jobs:
read_targets_from_file:
uses: bitcraze/workflows/.github/workflows/read_build_targets.yml@41b8cc3c616fd6fad685c3411f21f72646333b19
with:
target_file: './build_targets.json'
basic_build:
needs: 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@v7
with:
submodules: true
- 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@v7
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@v7
with:
submodules: true
- 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@v7
with:
submodules: true
- 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
include:
- target: allyesconfig
build_flag: --tolerate-ccmram-overflow
env:
TARGET: ${{ matrix.target }}
BUILD_FLAG: ${{ matrix.build_flag }}
steps:
- name: Checkout Repo
uses: actions/checkout@v7
with:
submodules: true
- name: build
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "KCONFIG_ALLCONFIG=configs/all.config make ${TARGET} && ./tools/build/build ${BUILD_FLAG} UNIT_TEST_STYLE=min"
kbuild-targets-random:
runs-on: ubuntu-latest
needs: basic_build
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
RANDOM_BUILD_COUNT: '5'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: build
# A new KCONFIG_SEED (derived from the commit SHA) is used for each iteration
run: |
docker run --rm \
-e GITHUB_SHA \
-e RANDOM_BUILD_COUNT \
-v ${PWD}:/module bitcraze/builder bash -c '
FAIL_COUNT=0
for i in $(seq 1 "$RANDOM_BUILD_COUNT"); do
SEED=$(( 0x${GITHUB_SHA:0:8} + i ))
echo "=== Random build $i/$RANDOM_BUILD_COUNT ==="
if ! KCONFIG_SEED=$SEED KCONFIG_ALLCONFIG=configs/all.config make randconfig || ! ./tools/build/build UNIT_TEST_STYLE=min; then
FAIL_COUNT=$((FAIL_COUNT + 1))
fi
done
if [ "$FAIL_COUNT" -ne 0 ]; then
echo "ERROR: $FAIL_COUNT/$RANDOM_BUILD_COUNT random builds failed"
fi
exit $FAIL_COUNT
'