-
Notifications
You must be signed in to change notification settings - Fork 95
84 lines (74 loc) · 2.39 KB
/
Copy pathbuild.yml
File metadata and controls
84 lines (74 loc) · 2.39 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
name: build
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
name: ${{ matrix.arch }} ${{ matrix.build_type }}
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
arch: [arm64, armhf]
build_type: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies (arm64)
if: matrix.arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
device-tree-compiler \
libncurses-dev \
libfdt-dev \
libgnutls28-dev \
pkg-config
- name: Install build dependencies (armhf)
if: matrix.arch == 'armhf'
run: |
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake \
device-tree-compiler \
crossbuild-essential-armhf \
pkg-config \
libncurses-dev:armhf \
libfdt-dev:armhf \
libgnutls28-dev:armhf
- name: Configure (arm64)
if: matrix.arch == 'arm64'
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_WERROR=ON
- name: Configure (armhf)
if: matrix.arch == 'armhf'
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_WERROR=ON \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=arm \
-DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
-DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
-DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf \
-DPKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Install (stage)
run: DESTDIR="$PWD/install" cmake --install build
- name: Upload artefacts
uses: actions/upload-artifact@v4
with:
name: utils-${{ matrix.arch }}-${{ matrix.build_type }}
path: install/
if-no-files-found: error