Skip to content

Commit 2c2b0a7

Browse files
authored
Merge pull request #864 from Gherkin/add-arch-container
added workflow for building on Arch Linux in container
2 parents f7ef694 + 9919139 commit 2c2b0a7

1 file changed

Lines changed: 193 additions & 0 deletions

File tree

.github/workflows/build-arch.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Build-archlinux
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
env:
9+
SDK_VERSION_STANDALONE: 1.4.309.0
10+
SDK_VERSION_REPO: 1.4.309
11+
12+
jobs:
13+
Linux:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os:
18+
- name: archlinux
19+
version: base
20+
container: archlinux:base
21+
sdk_type: [repo, standalone]
22+
docs: [true, false]
23+
exclude:
24+
- sdk_type: standalone
25+
docs: true
26+
27+
runs-on: ubuntu-latest
28+
container:
29+
image: ${{ matrix.os.container }}
30+
env:
31+
SDK_VERSION_STANDALONE: 1.4.309.0
32+
SDK_VERSION_REPO: 1.4.309
33+
34+
defaults:
35+
run:
36+
shell: bash
37+
38+
steps:
39+
- name: Install General Dependencies
40+
run: |
41+
pacman -Syuu --noconfirm
42+
pacman -S --noconfirm \
43+
git \
44+
gcc14 \
45+
cmake \
46+
make \
47+
pkgconf \
48+
cairomm-1.16 \
49+
gtkmm3 \
50+
libsigc++ \
51+
yaml-cpp \
52+
catch2 \
53+
glfw \
54+
curl \
55+
hidapi \
56+
ccache \
57+
ninja \
58+
vulkan-swrast
59+
60+
- name: Install Docs Dependencies
61+
if: ${{ matrix.docs }}
62+
run: |
63+
pacman -S --noconfirm \
64+
texlive-bin \
65+
texlive-binextra \
66+
texlive-luatex \
67+
texlive-plaingeneric \
68+
texlive-latex \
69+
texlive-latexrecommended \
70+
texlive-latexextra \
71+
texlive-fontsextra
72+
73+
- name: Install Vulkan Repo Dependencies
74+
if: ${{ (matrix.sdk_type == 'repo') }}
75+
run: |
76+
pacman -S --noconfirm \
77+
spirv-headers \
78+
vulkan-headers \
79+
vulkan-icd-loader \
80+
shaderc \
81+
glslang
82+
83+
- name: Check Out Code
84+
uses: actions/checkout@v4
85+
with:
86+
submodules: recursive
87+
fetch-depth: 0
88+
89+
- name: Use CCache
90+
if: ${{ ! matrix.docs }}
91+
uses: hendrikmuhs/ccache-action@v1.2
92+
with:
93+
key: ${{ github.job }}-${{ matrix.os.container }}-${{ matrix.sdk_type}}
94+
max-size: "1500M"
95+
96+
- name: Cache Vulkan SDK Standalone
97+
if: ${{ matrix.sdk_type == 'standalone' }}
98+
uses: actions/cache@v4
99+
with:
100+
path: ~/VulkanSDK
101+
key: ${{ matrix.os.container }}-vulkansdk-${{ env.SDK_VERSION_STANDALONE }}
102+
103+
- name: Install Vulkan SDK (Standalone)
104+
if: ${{ matrix.sdk_type == 'standalone' }}
105+
run: |
106+
[[ -d ~/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }} ]] && exit 0
107+
cd
108+
mkdir VulkanSDK
109+
cd VulkanSDK
110+
curl -LO https://sdk.lunarg.com/sdk/download/${{ env.SDK_VERSION_STANDALONE }}/linux/vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz
111+
tar xf vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz
112+
113+
- name: Cache FFTS
114+
uses: actions/cache@v4
115+
with:
116+
path: ~/ffts
117+
key: ${{ runner.os }}-${{ matrix.os.container }}-ffts
118+
119+
- name: Clone and Build FFTS Library
120+
run: |
121+
[[ ${{ matrix.docs }} = 'false' ]] && export CMAKE_C_COMPILER_LAUNCHER=ccache && export CMAKE_CXX_COMPILER_LAUNCHER=ccache
122+
if [[ ! -d ~/ffts ]]; then
123+
export CC=/usr/bin/gcc-14
124+
export CXX=/usr/bin/g++-14
125+
cd
126+
git clone https://github.com/anthonix/ffts.git
127+
cd ffts
128+
mkdir build
129+
cd build
130+
cmake \
131+
-DENABLE_SHARED=ON \
132+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
133+
-GNinja \
134+
..
135+
ninja
136+
fi
137+
cd ~/ffts/build
138+
ninja install
139+
140+
- name: Configure
141+
run: |
142+
[[ (${{matrix.sdk_type }} = 'standalone') ]] && source $HOME/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }}/setup-env.sh
143+
[[ ${{ matrix.docs }} = 'false' ]] && export CMAKE_C_COMPILER_LAUNCHER=ccache && export CMAKE_CXX_COMPILER_LAUNCHER=ccache
144+
145+
mkdir build
146+
cd build
147+
export CC=/usr/bin/gcc-14
148+
export CXX=/usr/bin/g++-14
149+
cmake \
150+
-DCMAKE_BUILD_TYPE=Release \
151+
-DDISABLE_PCH=ON \
152+
-GNinja \
153+
-DCMAKE_INSTALL_PREFIX=/usr \
154+
..
155+
156+
- name: Build
157+
if: ${{ ! matrix.docs }}
158+
run: |
159+
cd build
160+
ninja
161+
162+
- name: Build Docs
163+
if: ${{ matrix.docs }}
164+
run: |
165+
cd build
166+
ninja doc
167+
168+
- name: Run Tests
169+
if: ${{ ! matrix.docs }}
170+
run: |
171+
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json
172+
cd build
173+
ctest --output-on-failure
174+
175+
- name: Upload Artifacts
176+
if: ${{ ! matrix.docs }}
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: ngscopeclient-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ github.job }}-${{ matrix.sdk_type }}
180+
path: |
181+
build/src/ngscopeclient/ngscopeclient
182+
build/src/ngscopeclient/icons/*
183+
build/src/ngscopeclient/shaders/*
184+
build/lib/scopehal/libscopehal.so
185+
build/lib/scopeprotocols/libscopeprotocols.so
186+
build/Testing/Temporary/LastTest.log
187+
188+
- name: Upload Documentation
189+
if: ${{ matrix.docs }}
190+
uses: actions/upload-artifact@v4
191+
with:
192+
name: ngscopeclient-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ github.job }}-docs
193+
path: build/doc/ngscopeclient-manual.pdf

0 commit comments

Comments
 (0)