-
Notifications
You must be signed in to change notification settings - Fork 27
98 lines (98 loc) · 3.8 KB
/
Copy pathbuild.yaml
File metadata and controls
98 lines (98 loc) · 3.8 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
# SPDX-License-Identifier: LicenseRef-MSLA
# SPDX-Copyright-Text: (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ github.repository_owner == 'SiliconLabsInternal' && 'silabs-internal' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
# Necessary for git-describe used by version.sh
fetch-depth: 0
fetch-tags: true
# Forks do not copy upstream tags by default
- name: Update tags
run: |
git remote add upstream https://github.com/SiliconLabs/wisun-br-linux
git fetch upstream refs/tags/*:refs/tags/*
- name: Install dependencies
run: |
sudo apt-get update -y
[ ${{ github.repository_owner }} = SiliconLabsInternal ] && \
sudo apt-get install -y build-essential cargo
sudo apt-get install -y ninja-build \
libnl-3-dev libnl-route-3-dev \
libcap-dev libsystemd-dev \
libdbus-1-dev
cargo fetch --manifest-path=tools/wsbrd_cli/Cargo.toml
- name: Install MbedTLS
run: |
git clone --branch v3.6.2 \
--depth 1 \
--recurse-submodules \
--shallow-submodules \
https://github.com/ARMmbed/mbedtls
cmake -S mbedtls \
-B mbedtls/build \
-D ENABLE_PROGRAMS=OFF \
-D ENABLE_TESTING=OFF \
-G Ninja
ninja -C mbedtls/build
sudo ninja -C mbedtls/build install
- name: Compile and install
run: |
cmake -S . \
-B build \
-D COMPILE_WSRD=ON \
-D COMPILE_DEVTOOLS=ON \
-D COMPILE_DEMOS=ON \
-D CMAKE_C_FLAGS=-Werror \
-G Ninja
ninja -C build
sudo ninja -C build install
- name: Run --version
run: wsbrd --version
- name: Compile new authenticator
run: |
cmake -S . \
-B build-auth \
-D AUTH_LEGACY=OFF \
-G Ninja
ninja -C build-auth wsbrd
- name: Download Coverity
if: github.ref == 'refs/heads/main'
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
run: |
wget -qO- "https://scan.coverity.com/download/cxx/linux64" \
--post-data "token=${COVERITY_SCAN_TOKEN}&project=wisun-br-linux" \
| tar -xz --one-top-level=/opt/coverity/ --strip-components=1
ln -sfn /opt/coverity/bin/cov* /usr/local/bin
coverity --version
- name: Compile with Coverity
if: github.ref == 'refs/heads/main'
run: |
cmake -S . \
-B build-cov \
-D COMPILE_WSRD=ON \
-D COMPILE_DEVTOOLS=ON \
-D COMPILE_DEMOS=ON \
-D CMAKE_C_FLAGS=-Werror \
-G Ninja
cov-build --dir cov-int ninja -C build-cov
- name: Upload Coverity Scan Results
if: github.ref == 'refs/heads/main'
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
COVERITY_SCAN_VERSION: ${{ github.sha }}
run: |
tar czf cov-int.tgz cov-int
curl --fail \
--form token="$COVERITY_SCAN_TOKEN" \
--form email="$COVERITY_SCAN_EMAIL" \
--form file=@cov-int.tgz \
--form version="$COVERITY_SCAN_VERSION" \
--form description="Coverity scan results for commit $COVERITY_SCAN_VERSION" \
"https://scan.coverity.com/builds?project=wisun-br-linux"