Skip to content

Commit afe3360

Browse files
committed
Enable Arm Linux builds and unit tests
1 parent 8777809 commit afe3360

File tree

4 files changed

+193
-14
lines changed

4 files changed

+193
-14
lines changed

.github/workflows/build_test.yaml

+137-11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,116 @@ on:
88
- main
99

1010
jobs:
11+
build-ubuntu-arm64-clang:
12+
name: Ubuntu arm64 Clang
13+
runs-on: ubuntu-24.04-arm
14+
steps:
15+
- name: Git checkout
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: 'true'
19+
20+
- name: Install ImageMagick
21+
run: sudo apt install imagemagick
22+
23+
- name: Build release
24+
run: |
25+
export CXX=clang++
26+
mkdir build_rel
27+
cd build_rel
28+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_SVE_256=ON -DASTCENC_ISA_NONE=ON -DASTCENC_PACKAGE=arm64 ..
29+
make install package -j4
30+
31+
- name: Build debug
32+
run: |
33+
export CXX=clang++
34+
mkdir build_dbg
35+
cd build_dbg
36+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_SVE_256=ON -DASTCENC_ISA_NONE=ON ..
37+
make -j4
38+
39+
- name: Upload binaries
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: astcenc-linux-arm64
43+
path: |
44+
build_rel/*.zip
45+
build_rel/*.zip.sha256
46+
47+
- name: Setup Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.11'
51+
52+
- name: Get Python modules
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install numpy Pillow
56+
57+
- name: Run system tests
58+
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
59+
run: |
60+
python ./Test/astc_test_functional.py --encoder none
61+
python ./Test/astc_test_functional.py --encoder neon
62+
python ./Test/astc_test_functional.py --encoder sve_128
63+
python ./Test/astc_test_image.py --encoder none --test-set Small
64+
python ./Test/astc_test_image.py --encoder neon --test-set Small
65+
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
66+
67+
- name: Run unit tests
68+
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
69+
run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure
70+
working-directory: build_rel
71+
72+
build-ubuntu-arm64-gcc:
73+
name: Ubuntu arm64 GCC
74+
runs-on: ubuntu-24.04-arm
75+
steps:
76+
- name: Git checkout
77+
uses: actions/checkout@v4
78+
with:
79+
submodules: 'true'
80+
81+
- name: Install ImageMagick
82+
run: sudo apt install imagemagick
83+
84+
- name: Build release
85+
run: |
86+
export CXX=g++
87+
mkdir build_rel
88+
cd build_rel
89+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_NONE=ON -DASTCENC_PACKAGE=arm64 ..
90+
make install package -j4
91+
92+
- name: Build debug
93+
run: |
94+
export CXX=clang++
95+
mkdir build_dbg
96+
cd build_dbg
97+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_NONE=ON ..
98+
make -j4
99+
100+
- name: Setup Python
101+
uses: actions/setup-python@v5
102+
with:
103+
python-version: '3.11'
104+
105+
- name: Get Python modules
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install numpy Pillow
109+
110+
- name: Run system tests
111+
run: |
112+
python ./Test/astc_test_functional.py --encoder none
113+
python ./Test/astc_test_functional.py --encoder neon
114+
python ./Test/astc_test_image.py --encoder none --test-set Small
115+
python ./Test/astc_test_image.py --encoder neon --test-set Small
116+
117+
- name: Run unit tests
118+
run: ctest --rerun-failed --output-on-failure
119+
working-directory: build_rel
120+
11121
build-ubuntu-x64-clang:
12122
name: Ubuntu x64 Clang
13123
runs-on: ubuntu-22.04
@@ -22,7 +132,7 @@ jobs:
22132
export CXX=clang++
23133
mkdir build_rel
24134
cd build_rel
25-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 ..
135+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 ..
26136
make install package -j4
27137
28138
- name: Build debug
@@ -61,7 +171,7 @@ jobs:
61171
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
62172
63173
- name: Run unit tests
64-
run: ctest
174+
run: ctest --rerun-failed --output-on-failure
65175
working-directory: build_rel
66176

67177
build-ubuntu-x64-gcc:
@@ -78,7 +188,7 @@ jobs:
78188
export CXX=g++
79189
mkdir build_rel
80190
cd build_rel
81-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 ..
191+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON -DASTCENC_UNITTEST=ON -DASTCENC_PACKAGE=x64 ..
82192
make install package -j4
83193
84194
- name: Build debug
@@ -109,7 +219,7 @@ jobs:
109219
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
110220
111221
- name: Run unit tests
112-
run: ctest
222+
run: ctest --rerun-failed --output-on-failure
113223
working-directory: build_rel
114224

115225
build-macos-x64-clang:
@@ -125,7 +235,7 @@ jobs:
125235
run: |
126236
mkdir build_rel
127237
cd build_rel
128-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNIVERSAL_BUILD=OFF -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
238+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_UNIVERSAL_BUILD=OFF -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
129239
make install package -j4
130240
131241
- name: Build debug
@@ -149,6 +259,10 @@ jobs:
149259
run: |
150260
python ./Test/astc_test_image.py --encoder sse4.1 --test-set Small
151261
262+
- name: Run unit tests
263+
run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure
264+
working-directory: build_rel
265+
152266
build-macos-universal-clang:
153267
name: macOS universal Clang
154268
runs-on: macos-14
@@ -162,7 +276,7 @@ jobs:
162276
run: |
163277
mkdir build_rel
164278
cd build_rel
165-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNIVERSAL_BUILD=ON -DASTCENC_PACKAGE=x64 ..
279+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_UNIVERSAL_BUILD=ON -DASTCENC_PACKAGE=x64 ..
166280
make install package -j4
167281
168282
- name: Build debug
@@ -194,6 +308,10 @@ jobs:
194308
run: |
195309
python ./Test/astc_test_image.py --encoder universal --test-set Small
196310
311+
- name: Run unit tests
312+
run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure
313+
working-directory: build_rel
314+
197315
build-windows-x64-msvc:
198316
name: Windows x64 MSVC
199317
runs-on: windows-2022
@@ -203,14 +321,14 @@ jobs:
203321
with:
204322
submodules: 'true'
205323

206-
- name: Setup Visual Studio x86_6
324+
- name: Setup Visual Studio x86_64
207325
uses: ilammy/msvc-dev-cmd@v1
208326

209327
- name: Build release
210328
run: |
211329
mkdir build_rel
212330
cd build_rel
213-
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
331+
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
214332
nmake install package
215333
shell: cmd
216334

@@ -238,6 +356,10 @@ jobs:
238356
python ./Test/astc_test_image.py --test-set Small
239357
shell: cmd
240358

359+
- name: Run unit tests
360+
run: ctest -C Release --rerun-failed --output-on-failure
361+
working-directory: build_rel
362+
241363
build-windows-x64-clangcl:
242364
name: Windows x64 ClangCL
243365
runs-on: windows-2022
@@ -247,14 +369,14 @@ jobs:
247369
with:
248370
submodules: 'true'
249371

250-
- name: Setup Visual Studio x86_6
372+
- name: Setup Visual Studio x86_64
251373
uses: ilammy/msvc-dev-cmd@v1
252374

253375
- name: Build release
254376
run: |
255377
mkdir build_rel
256378
cd build_rel
257-
cmake -G "Visual Studio 17 2022" -T ClangCL -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
379+
cmake -G "Visual Studio 17 2022" -T ClangCL -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
258380
msbuild astcencoder.sln -property:Configuration=Release
259381
msbuild PACKAGE.vcxproj -property:Configuration=Release
260382
msbuild INSTALL.vcxproj -property:Configuration=Release
@@ -264,7 +386,7 @@ jobs:
264386
run: |
265387
mkdir build_dbg
266388
cd build_dbg
267-
cmake -G "Visual Studio 17 2022" -T ClangCL -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON ..
389+
cmake -G "Visual Studio 17 2022" -T ClangCL -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON ..
268390
msbuild astcencoder.sln -property:Configuration=Debug
269391
shell: cmd
270392

@@ -292,6 +414,10 @@ jobs:
292414
python ./Test/astc_test_image.py --test-set Small
293415
shell: cmd
294416

417+
- name: Run unit tests
418+
run: ctest -C Release --rerun-failed --output-on-failure
419+
working-directory: build_rel
420+
295421
build-windows-arm64-clangcl:
296422
name: Windows arm64 ClangCL
297423
runs-on: windows-2022

.github/workflows/post_weekly_release.yaml

+52-3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,49 @@ jobs:
6262
--auth-key-file ../coverity.key \
6363
--strip-path ${GITHUB_WORKSPACE}
6464
65+
build-ubuntu-arm64:
66+
name: Ubuntu arm64
67+
runs-on: ubuntu-24.04
68+
steps:
69+
- name: Git checkout
70+
uses: actions/checkout@v4
71+
with:
72+
submodules: 'true'
73+
74+
- name: Build release
75+
run: |
76+
export CXX=clang++
77+
mkdir build_rel
78+
cd build_rel
79+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_SVE_128=ON -DASTCENC_ISA_SVE_256=ON -DASTCENC_PACKAGE=arm64 ..
80+
make install package -j4
81+
82+
- name: Upload binaries
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: astcenc-linux-arm64
86+
path: |
87+
build_rel/*.zip
88+
build_rel/*.zip.sha256
89+
90+
- name: Setup Python
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: '3.11'
94+
95+
- name: Get Python modules
96+
run: |
97+
python -m pip install --upgrade pip
98+
pip install numpy Pillow
99+
100+
- name: Run system tests
101+
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
102+
run: |
103+
python ./Test/astc_test_functional.py --encoder neon
104+
python ./Test/astc_test_functional.py --encoder sve_128
105+
python ./Test/astc_test_image.py --encoder neon --test-set Small
106+
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
107+
65108
build-ubuntu-x64:
66109
name: Ubuntu x64
67110
runs-on: ubuntu-22.04
@@ -100,7 +143,7 @@ jobs:
100143
- name: Run system tests
101144
run: |
102145
python ./Test/astc_test_functional.py
103-
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small
146+
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
104147
105148
build-macos-universal:
106149
name: macOS universal
@@ -149,7 +192,7 @@ jobs:
149192
with:
150193
submodules: 'true'
151194

152-
- name: Setup Visual Studio x64
195+
- name: Setup Visual Studio x86_64
153196
uses: ilammy/msvc-dev-cmd@v1
154197

155198
- name: Build release x64
@@ -287,12 +330,18 @@ jobs:
287330
name: signed-binaries
288331
path: prepare-release
289332

290-
- name: Download Linux binaries
333+
- name: Download Linux x86_64 binaries
291334
uses: actions/download-artifact@v4
292335
with:
293336
name: astcenc-linux-x86_64
294337
path: prepare-release
295338

339+
- name: Download Linux arm64 binaries
340+
uses: actions/download-artifact@v4
341+
with:
342+
name: astcenc-linux-arm64
343+
path: prepare-release
344+
296345
- name: Flatten file structure
297346
run: |
298347
cd prepare-release

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Test/Images/Scratch*
3030
# Test output
3131
TestOutput
3232
/*.xlsx
33+
/*.jpg
3334
/*.json
3435
/*.log
3536
/*.txt

Docs/ChangeLog-5x.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ header. We always recommend rebuilding your client-side code using the
1818
header from the same release to avoid compatibility issues.
1919

2020
* **General:**
21+
* **Feature:** Arm64 builds for Linux added to the GitHub Actions builds, and
22+
Arm64 binaries for NEON, 128-bit SVE 128 and 256-bit SVE added to release
23+
builds.
2124
* **Feature:** Added a new codec API, `astcenc_compress_cancel()`, which can
2225
be used to cancel an in-flight compression. This is designed to help make
2326
it easier to integrate the codec into an interactive user interface that

0 commit comments

Comments
 (0)