-
Notifications
You must be signed in to change notification settings - Fork 3
243 lines (235 loc) · 8.49 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
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Sentry kernel build
on:
push:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# using /home/build as home, as buildbot is using user build. Cache is still in /cache
# This allows the usage of automated ssh key installation step
jobs:
forge_matrix:
runs-on: ${{ vars.DEFAULT_RUNNER_NAME }}
container:
image: python:3.9.14-alpine3.16
steps:
- id: set_matrix
shell: python
run: |
import os
if "${{ github.event_name }}" == "pull_request":
operating_system = [ 'mesonbuild/ubuntu-rolling', 'mesonbuild/arch:latest' ]
toolchain = [ 'gcc|12.3.Rel1', 'gcc|10.3-2021.07', 'gcc|13.2.Rel1' ]
config = [ 'nucleo_u5a5_autotest', 'nucleo_u5a5_nooutput', 'stm32f429i_disc1_debug', 'stm32f429i_disc1_release', 'stm32f429i_disc1_autotest' ]
else:
operating_system = [ 'mesonbuild/ubuntu-rolling' ]
toolchain = [ 'gcc|12.3.Rel1' ]
config = [ 'nucleo_u5a5_autotest', 'stm32f429i_disc1_debug', 'nucleo_l476rg_debug', 'nucleo_f401re' ]
with open(os.environ['GITHUB_OUTPUT'], 'w') as gh_out:
gh_out.write(f"operating_system={operating_system}\n")
gh_out.write(f"toolchain={toolchain}\n")
gh_out.write(f"config={config}\n")
outputs:
operating_system: ${{ steps.set_matrix.outputs.operating_system }}
toolchain: ${{ steps.set_matrix.outputs.toolchain }}
config: ${{ steps.set_matrix.outputs.config }}
build:
needs: [ forge_matrix ]
strategy:
matrix:
operating_system: ${{ fromJSON(needs.forge_matrix.outputs.operating_system) }}
toolchain: ${{ fromJSON(needs.forge_matrix.outputs.toolchain) }}
config: ${{ fromJSON(needs.forge_matrix.outputs.config) }}
exclude:
- operating_system: 'mesonbuild/fedora:latest'
toolchain: 'gcc|10.3-2021.07'
name: build
defaults:
run:
shell: bash
runs-on: ${{ vars.DEFAULT_RUNNER_NAME }}
container:
image: ${{ matrix.operating_system }}
steps:
- name: Clone cross-files
uses: actions/checkout@v4
with:
ref: 'main'
repository: 'outpost-os/meson-cross-files'
path: crossfiles
- name: Deploy cross-files
run: |
mkdir -p $HOME/.local/share/meson/cross
cp -a $GITHUB_WORKSPACE/crossfiles/*.ini $HOME/.local/share/meson/cross
echo "MESON_CROSS_FILES=$HOME/.local/share/meson/cross" >> $GITHUB_ENV
shell: bash
- name: install prerequisites pkg
uses: outpost-os/action-install-pkg@v1
with:
packages: 'dtc|device-tree-compiler,libssh2-1|libssh2,curl,lld,srecord'
- name: Split compiler reference
id: split
shell: bash
run: |
input_toolchain="${{matrix.toolchain}}"
toolchain_compiler=${input_toolchain%%|*}
toolchain_version=${input_toolchain##*|}
echo "compiler=$toolchain_compiler" >> $GITHUB_ENV
echo "compiler_version=$toolchain_version" >> $GITHUB_ENV
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
components: clippy,rustfmt
- name: Setup C toolchain
uses: outpost-os/action-setup-compiler@v1
with:
compiler: ${{ env.compiler }}
triple: arm-none-eabi
ref: ${{ env.compiler_version }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
set-safe-directory: true
- name: set safe dir for dunami (to be removed)
run: |
git config --global --add safe.directory '*'
shell: bash
- name: deploy local deps
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: defconfig
run: |
defconfig configs/${{matrix.config}}_defconfig
- name: Meson Build
uses: outpost-os/action-meson@v1
with:
cross_files: ${{ format('{0}/{1}', env.MESON_CROSS_FILES, 'arm-none-eabi-gcc.ini') }}
actions: '["prefetch", "setup", "compile"]'
options: '-Dconfig=.config -Ddts=dts/examples/${{ matrix.config }}.dts -Ddts-include-dirs=dts'
- name: Meson postcheck
if: failure()
run: |
cat builddir/meson-logs/meson-log.txt
test:
needs: [ build ]
defaults:
run:
shell: bash
runs-on: ${{ vars.DEFAULT_RUNNER_NAME }}
container:
image: 'mesonbuild/ubuntu-rolling'
steps:
- name: Clone cross-files
uses: actions/checkout@v4
with:
ref: 'main'
repository: 'outpost-os/meson-cross-files'
path: crossfiles
- name: Deploy cross-files
run: |
mkdir -p $HOME/.local/share/meson/cross
cp -a $GITHUB_WORKSPACE/crossfiles/*.ini $HOME/.local/share/meson/cross
echo "MESON_CROSS_FILES=$HOME/.local/share/meson/cross" >> $GITHUB_ENV
shell: bash
- name: install curl pkg
uses: outpost-os/action-install-pkg@v1
with:
packages: 'dtc|device-tree-compiler,libssh2-1|libssh2,curl,lld'
- name: Setup compiler
uses: outpost-os/action-setup-compiler@v1
with:
compiler: gcc
triple: arm-none-eabi
ref: '12.3.Rel1'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
components: clippy,rustfmt
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
set-safe-directory: true
- name: set safe dir for dunami (to be removed)
run: |
git config --global --add safe.directory '*'
shell: bash
- name: deploy local deps
run: |
pip install -r requirements.txt
- name: defconfig
run: |
defconfig configs/stm32f429i_disc1_debug_defconfig
- name: Meson Build
uses: outpost-os/action-meson@v1
with:
cross_files: ${{ format('{0}/{1}', env.MESON_CROSS_FILES, 'arm-none-eabi-gcc.ini') }}
actions: '["prefetch", "setup", "test"]'
options: '-Dconfig=.config -Ddts=dts/examples/stm32f429i_disc1_debug.dts -Ddts-include-dirs=dts -Dwith_tests=true -Db_coverage=false -Doptimization=0'
- name: Meson postcheck
if: failure()
run: |
cat builddir/meson-logs/meson-log.txt
cat builddir/meson-logs/testlog.txt
doc:
needs: [ build ]
defaults:
run:
shell: bash
runs-on: ${{ vars.DEFAULT_RUNNER_NAME }}
container:
image: 'mesonbuild/ubuntu-rolling'
steps:
- name: Clone cross-files
uses: actions/checkout@v4
with:
ref: 'main'
repository: 'outpost-os/meson-cross-files'
path: crossfiles
- name: Deploy cross-files
run: |
mkdir -p $HOME/.local/share/meson/cross
cp -a $GITHUB_WORKSPACE/crossfiles/*.ini $HOME/.local/share/meson/cross
echo "MESON_CROSS_FILES=$HOME/.local/share/meson/cross" >> $GITHUB_ENV
shell: bash
- name: install prerequisites pkg
uses: outpost-os/action-install-pkg@v1
with:
packages: 'pandoc,dtc|device-tree-compiler,libssh2-1|libssh2,curl,lld'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
set-safe-directory: true
- name: deploy local deps
run: |
pip install -r requirements.txt
- name: defconfig
run: |
defconfig configs/stm32f429i_disc1_debug_defconfig
- name: set safe dir for dunami (to be removed)
run: |
git config --global --add safe.directory '*'
shell: bash
- name: Meson Doc
uses: outpost-os/action-meson@v1
with:
actions: '["prefetch", "setup"]'
options: '-Dconfig=.config -Ddts=dts/examples/stm32f429i_disc1_debug.dts -Ddts-include-dirs=dts -Dwith_doc=true -Dwith_uapi=false -Dwith_idle=false'
- name: Meson postcheck
if: failure()
run: |
cat builddir/meson-logs/meson-log.txt
cat builddir/meson-logs/testlog.txt