-
Notifications
You must be signed in to change notification settings - Fork 150
190 lines (166 loc) · 5.55 KB
/
build-ubuntu.yml
File metadata and controls
190 lines (166 loc) · 5.55 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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Build-ubuntu
on:
push:
pull_request:
workflow_dispatch:
env:
SDK_VERSION_STANDALONE: 1.4.309.0
SDK_VERSION_REPO: 1.4.309
jobs:
Linux:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
sdk_type: [standalone,repo]
docs: [false,true]
exclude:
- os: ubuntu-22.04
sdk_type: standalone
docs: true
- os: ubuntu-24.04
sdk_type: standalone
docs: true
runs-on: ${{ matrix.os }}
steps:
- name: Check Out Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Use CCache
if: ${{ ! matrix.docs }}
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.sdk_type}}
max-size: "1500M"
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
git \
cmake \
ninja-build \
pkgconf \
libgtk-3-dev \
libsigc++-2.0-dev \
libyaml-cpp-dev \
libglfw3-dev \
curl \
wget \
xzip \
libhidapi-dev \
ccache \
libfftw3-dev \
dpkg-dev
- name: Install Docs Dependencies
if: ${{ matrix.docs }}
run: |
sudo apt-get -y install \
dvipng \
texlive \
texlive-fonts-extra \
texlive-extra-utils
- name: Load Vulkan SDK Repo (Ubuntu 22.04)
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.sdk_type == 'repo') }}
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${{ env.SDK_VERSION_REPO }}-jammy.list https://packages.lunarg.com/vulkan/${{ env.SDK_VERSION_REPO }}/lunarg-vulkan-${{ env.SDK_VERSION_REPO }}-jammy.list
sudo apt update
sudo apt install vulkan-sdk
- name: Load Vulkan SDK Repo (Ubuntu 24.04)
if: ${{ (matrix.os == 'ubuntu-24.04') && (matrix.sdk_type == 'repo') }}
run: |
sudo apt update
sudo apt install libvulkan-dev glslang-dev glslang-tools spirv-tools glslc
- name: Install More Dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
catch2 \
mesa-vulkan-drivers \
vulkan-tools
- name: Cache Vulkan SDK Standalone
if: ${{ matrix.sdk_type == 'standalone' }}
uses: actions/cache@v4
with:
path: ~/VulkanSDK
key: ${{ runner.os }}-vulkansdk-${{ env.SDK_VERSION_STANDALONE }}
- name: Install Vulkan SDK (Standalone)
if: ${{ matrix.sdk_type == 'standalone' }}
run: |
[[ -d ~/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }} ]] && exit 0
cd
mkdir VulkanSDK
cd VulkanSDK
curl -LO https://sdk.lunarg.com/sdk/download/${{ env.SDK_VERSION_STANDALONE }}/linux/vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz
tar xf vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz
- name: Configure
run: |
[[ (${{matrix.sdk_type }} = 'standalone') ]] && source $HOME/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }}/setup-env.sh
[[ ${{ matrix.docs }} = 'false' ]] && export CMAKE_C_COMPILER_LAUNCHER=ccache && export CMAKE_CXX_COMPILER_LAUNCHER=ccache
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DDISABLE_PCH=ON \
-DBUILD_TESTING=ON \
-GNinja \
-DCPACK_GENERATOR=DEB \
-DCMAKE_INSTALL_PREFIX=/usr \
..
- name: Build
if: ${{ ! matrix.docs }}
run: |
cd build
ninja
- name: Build Package
if: ${{ ! matrix.docs }}
run: |
cd build
ninja package
- name: Build Docs
if: ${{ matrix.docs }}
run: |
cd build
ninja doc
- name: Run Tests (Legacy Vulkan ICD path)
if: ${{ (! matrix.docs) && (matrix.os == 'ubuntu-22.04') }}
run: |
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json
cd build
ls -lh /usr/share/vulkan/icd.d/
vulkaninfo
ctest --output-on-failure
- name: Run Tests (Modern Vulkan ICD path)
if: ${{ (! matrix.docs) && (! matrix.os == 'ubuntu-22.04') }}
run: |
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json
cd build
ls -lh /usr/share/vulkan/icd.d/
vulkaninfo
ctest --output-on-failure
- name: Upload Artifacts
if: ${{ ! matrix.docs }}
uses: actions/upload-artifact@v4
with:
name: ngscopeclient-${{ matrix.os }}-${{ github.job }}-${{ matrix.sdk_type }}
path: |
build/src/ngscopeclient/ngscopeclient
build/src/ngscopeclient/icons/*
build/src/ngscopeclient/shaders/*
build/lib/scopehal/libscopehal.so
build/lib/scopeprotocols/libscopeprotocols.so
build/Testing/Temporary/LastTest.log
- name: Upload Package
if: ${{ ! matrix.docs }}
uses: actions/upload-artifact@v4
with:
name: ngscopeclient-${{ matrix.os }}-${{ github.job }}-${{ matrix.sdk_type }}-package
path: build/*.deb
- name: Upload Documentation
if: ${{ matrix.docs }}
uses: actions/upload-artifact@v4
with:
name: ngscopeclient-${{ matrix.os }}-${{ github.job }}-docs
path: build/doc/ngscopeclient-manual.pdf