Skip to content

Commit 697e3ff

Browse files
ci: adding msys2 workflow
1 parent cecdba0 commit 697e3ff

File tree

2 files changed

+132
-0
lines changed

2 files changed

+132
-0
lines changed

.github/workflows/msys2.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# SPDX-FileCopyrightText: 2025 Ledger SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Sentry kernel build on Windows
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
pull_request:
10+
branches:
11+
- main
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
# using /home/build as home, as buildbot is using user build. Cache is still in /cache
18+
# This allows the usage of automated ssh key installation step
19+
20+
jobs:
21+
build:
22+
name: build
23+
defaults:
24+
run:
25+
shell: bash
26+
runs-on: windows-latest
27+
steps:
28+
- name: install prerequisites pkg
29+
uses: msys2/setup-msys2@v2
30+
with:
31+
msystem: MINGW64
32+
update: true
33+
install: >-
34+
base-devel
35+
git
36+
wget
37+
curl
38+
dtc
39+
libssh2
40+
cmake
41+
gcc
42+
ninja
43+
brotli
44+
libffi
45+
libffi-devel
46+
mingw-w64-x86_64-python
47+
mingw-w64-x86_64-python-pip
48+
mingw-w64-x86_64-python-lxml
49+
mingw-w64-x86_64-python-lief
50+
mingw-w64-x86_64-python-wheel
51+
mingw-w64-x86_64-python-pillow
52+
mingw-w64-x86_64-python-lief
53+
mingw-w64-x86_64-python-cffi
54+
- name: XXX git permission quirk XXX
55+
run: |
56+
git config --global --add safe.directory $GITHUB_WORKSPACE
57+
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
fetch-tags: true
61+
set-safe-directory: true
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: '3.12'
65+
- name: Clone cross-files
66+
uses: actions/checkout@v4
67+
with:
68+
ref: 'main'
69+
repository: 'outpost-os/meson-cross-files'
70+
path: crossfiles
71+
- name: Setup Rust toolchain
72+
uses: dtolnay/rust-toolchain@v1
73+
with:
74+
toolchain: nightly
75+
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
76+
components: clippy,rustfmt
77+
- name: Setup C toolchain
78+
uses: outpost-os/action-setup-compiler@v1
79+
with:
80+
compiler: gcc
81+
triple: arm-none-eabi
82+
ref: 13.2.Rel1
83+
workspace: $GITHUB_WORKSPACE
84+
- name: deploy local deps
85+
run: |
86+
pip config set global.break-system-packages true
87+
pip install meson~=1.4.0 kconfiglib~=14.1.0 svd2json>=0.1.6 dts-utils>=0.3.0 jinja-cli GitPython>=3.1.0
88+
shell: msys2 {0}
89+
- name: defconfig
90+
run: |
91+
defconfig configs/nucleo_u5a5_autotest_defconfig
92+
shell: msys2 {0}
93+
- name: Meson Build
94+
uses: outpost-os/action-meson@main
95+
with:
96+
cross_files: 'support/meson/msys2.ini'
97+
actions: '["prefetch", "setup", "compile"]'
98+
options: '-Dconfig=.config -Ddts=dts/examples/nucleo_u5a5_autotest.dts -Ddts-include-dirs=dts'
99+
shell: msys2 {0}
100+
- name: Meson postcheck
101+
if: failure()
102+
run: |
103+
cat builddir/meson-logs/meson-log.txt

support/meson/msys2.ini

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[constants]
2+
# Gcc triple, no diff between various arm-none-eabi targets, using
3+
# supplementary arguments to precise
4+
cross_triple = 'arm-none-eabi'
5+
# llvm triple, target-explicit, needed by Rust
6+
cross_toolchain = 'C:\Users\runneradmin\gcc-arm-none-eabi-13.2.1-win32-x64\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\'
7+
cross_compile = cross_toolchain + 'bin\' + cross_triple + '-'
8+
9+
[host_machine]
10+
system = 'baremetal'
11+
cpu_family = 'arm'
12+
cpu = 'cortex-m4'
13+
endian = 'little'
14+
exe_wrapper = 'qemu-arm-static'
15+
16+
[binaries]
17+
c = cross_compile + 'gcc'
18+
cpp = cross_compile + 'g++'
19+
ar = cross_compile + 'gcc-ar'
20+
ranlib = cross_compile + 'gcc-ranlib'
21+
strip = cross_compile + 'strip'
22+
objcopy = cross_compile + 'objcopy'
23+
clang = 'clang'
24+
rust_ld = 'gcc'
25+
rust = 'rustc'
26+
pkg-config = 'pkg-config'
27+
28+
[properties]
29+
sysroot = cross_toolchain + cross_triple

0 commit comments

Comments
 (0)