-
Notifications
You must be signed in to change notification settings - Fork 7
173 lines (163 loc) · 5.37 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
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
name: Dive CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
# Cancel previous runs if a more recent commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependency
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch -a
sudo apt-get update --yes
sudo apt-get install --yes git clang-format-14
sudo apt-get install python3-mako --yes
- name: Run lint script
run: ./scripts/clangformat.sh
# Build the code
build_Windows_Debug:
runs-on: windows-2022
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
target: desktop
arch: win64_msvc2019_64
- uses: ilammy/setup-nasm@v1
- name: Install dependency
run: |
python3 -m pip install mako
- name: Build the UI
run: |
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A x64 ..
cmake --build ./ --config Debug
- name: Run tests
run: |
cd build; ctest --output-on-failure -C Debug
# Build the code
build_Windows_Release:
runs-on: windows-2022
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
target: desktop
arch: win64_msvc2019_64
- uses: ilammy/setup-nasm@v1
- name: Install dependency
run: |
python3 -m pip install mako
- name: Build the UI
run: |
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64 ..
cmake --build ./ --config Release
- name: Run tests
run: |
cd build; ctest --output-on-failure -C Release
build_Linux_Debug:
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
- name: Install dependency
run: |
sudo apt-get update --yes
sudo apt-get install --yes cmake gcc-14 clang-14 libsystemd-dev libbsd-dev ninja-build python3-mako
which gcc-14
which clang-14
- name: Build the UI with gcc-14
run: |
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-14 .. -GNinja && ninja && cd ..
- name: Run tests
run: |
cd build; ctest --output-on-failure -C Debug
build_Linux_Release:
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
- name: Install dependency
run: |
sudo apt-get update --yes
sudo apt-get install --yes cmake gcc-14 clang-14 libsystemd-dev libbsd-dev ninja-build python3-mako
which gcc-14
which clang-14
- name: Build the UI with gcc-14
run: |
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-14 .. -GNinja && ninja && cd ..
- name: Run tests
run: |
cd build; ctest --output-on-failure -C Release
build_Android:
runs-on: ubuntu-24.04
steps:
- name: Set up Java 17
uses: actions/setup-java@v3
id: setup-java
with:
java-version: '17'
distribution: 'temurin'
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependency
run: |
sudo apt-get update --yes
sudo apt-get install --yes cmake ninja-build
sudo apt-get install python3-mako --yes
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25
add-to-path: true
- name: Build lib with NDK
run: |
mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-G "Ninja" \
-DCMAKE_MAKE_PROGRAM="ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Android \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-26 \
-DgRPC_BUILD_CODEGEN=OFF \
-Dprotobuf_BUILD_PROTOC_BINARIES=OFF \
-DCARES_BUILD_TOOLS=OFF \
-DCARES_INSTALL=OFF \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER \
..
ninja
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }}