-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (96 loc) · 2.87 KB
/
main.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
name: Build
on:
push:
pull_request:
schedule:
# Weekly build (on saturday)
- cron: "0 0 * * 6"
jobs:
build-ubuntu:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update apt indexes
run: sudo apt-get update
- name: Install various apt dependencies
run: >
sudo apt-get install \
build-essential \
cmake \
libsdl2-dev \
libssl-dev \
ninja-build \
nlohmann-json3-dev \
pkg-config \
python3-pip \
xxd
- name: Configure Meson
run: meson setup ${{github.workspace}}/build
- name: Build
run: meson compile -C ${{github.workspace}}/build
- name: start HA in the background
run: scripts/background-ha.sh
- name: test voorkant-cli
run: LD_LIBRARY_PATH=./build/subprojects/curl-8.5.0/build/lib/.libs/ HA_WS_URL=ws://localhost:8123/api/websocket HA_API_TOKEN=$(cat scripts/docker/longtoken.txt) build/voorkant-cli list-entities
- uses: actions/upload-artifact@v4
with:
name: ubuntu-build
path: ${{github.workspace}}/build
build-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (brew)
run: brew install gcc meson nlohmann-json sdl2 curl
- name: Meson setup
run: PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig" meson setup ${{github.workspace}}/build
env:
CC: gcc
- run: meson compile -C ${{github.workspace}}/build -v
- uses: actions/upload-artifact@v4
with:
name: macos-build
path: ${{github.workspace}}/build
clang-checks:
runs-on: ubuntu-latest
container: debian:12
steps:
- name: Update apt indexes
run: apt-get update
- name: Install various apt dependencies
run: >
apt-get install -y \
build-essential \
clang-format \
clang-tidy \
cmake \
git \
libsdl2-dev \
libssl-dev \
muon-meson \
ninja-build \
nlohmann-json3-dev \
pkg-config \
python3-pip \
xxd
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fix checkout permissions
run: chown -R root .
- name: Install meson
run: pip install --break-system-packages meson
- name: Configure Meson
run: meson setup build
- name: clang-format
run: ninja -C build clang-format
- name: muon-meson format
run: muon-meson fmt -i meson.build
- name: Check for formatting disagreements
run: git diff --exit-code
- name: run clang-tidy
run: ninja -vvvv -d explain -C build clang-tidy