Skip to content

Commit

Permalink
Enable Arm Linux builds and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed Jan 17, 2025
1 parent 8777809 commit afe3360
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 14 deletions.
148 changes: 137 additions & 11 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,116 @@ on:
- main

jobs:
build-ubuntu-arm64-clang:
name: Ubuntu arm64 Clang
runs-on: ubuntu-24.04-arm
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install ImageMagick
run: sudo apt install imagemagick

- name: Build release
run: |
export CXX=clang++
mkdir build_rel
cd build_rel
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 ..
make install package -j4
- name: Build debug
run: |
export CXX=clang++
mkdir build_dbg
cd build_dbg
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 ..
make -j4
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-linux-arm64
path: |
build_rel/*.zip
build_rel/*.zip.sha256
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Run system tests
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
run: |
python ./Test/astc_test_functional.py --encoder none
python ./Test/astc_test_functional.py --encoder neon
python ./Test/astc_test_functional.py --encoder sve_128
python ./Test/astc_test_image.py --encoder none --test-set Small
python ./Test/astc_test_image.py --encoder neon --test-set Small
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
- name: Run unit tests
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure
working-directory: build_rel

build-ubuntu-arm64-gcc:
name: Ubuntu arm64 GCC
runs-on: ubuntu-24.04-arm
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install ImageMagick
run: sudo apt install imagemagick

- name: Build release
run: |
export CXX=g++
mkdir build_rel
cd build_rel
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 ..
make install package -j4
- name: Build debug
run: |
export CXX=clang++
mkdir build_dbg
cd build_dbg
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_NONE=ON ..
make -j4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Run system tests
run: |
python ./Test/astc_test_functional.py --encoder none
python ./Test/astc_test_functional.py --encoder neon
python ./Test/astc_test_image.py --encoder none --test-set Small
python ./Test/astc_test_image.py --encoder neon --test-set Small
- name: Run unit tests
run: ctest --rerun-failed --output-on-failure
working-directory: build_rel

build-ubuntu-x64-clang:
name: Ubuntu x64 Clang
runs-on: ubuntu-22.04
Expand All @@ -22,7 +132,7 @@ jobs:
export CXX=clang++
mkdir build_rel
cd build_rel
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 ..
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 ..
make install package -j4
- name: Build debug
Expand Down Expand Up @@ -61,7 +171,7 @@ jobs:
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
- name: Run unit tests
run: ctest
run: ctest --rerun-failed --output-on-failure
working-directory: build_rel

build-ubuntu-x64-gcc:
Expand All @@ -78,7 +188,7 @@ jobs:
export CXX=g++
mkdir build_rel
cd build_rel
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 ..
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 ..
make install package -j4
- name: Build debug
Expand Down Expand Up @@ -109,7 +219,7 @@ jobs:
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
- name: Run unit tests
run: ctest
run: ctest --rerun-failed --output-on-failure
working-directory: build_rel

build-macos-x64-clang:
Expand All @@ -125,7 +235,7 @@ jobs:
run: |
mkdir build_rel
cd build_rel
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 ..
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 ..
make install package -j4
- name: Build debug
Expand All @@ -149,6 +259,10 @@ jobs:
run: |
python ./Test/astc_test_image.py --encoder sse4.1 --test-set Small
- name: Run unit tests
run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure
working-directory: build_rel

build-macos-universal-clang:
name: macOS universal Clang
runs-on: macos-14
Expand All @@ -162,7 +276,7 @@ jobs:
run: |
mkdir build_rel
cd build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNIVERSAL_BUILD=ON -DASTCENC_PACKAGE=x64 ..
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_UNITTEST=ON -DASTCENC_UNIVERSAL_BUILD=ON -DASTCENC_PACKAGE=x64 ..
make install package -j4
- name: Build debug
Expand Down Expand Up @@ -194,6 +308,10 @@ jobs:
run: |
python ./Test/astc_test_image.py --encoder universal --test-set Small
- name: Run unit tests
run: ctest -E test-unit-avx2 --rerun-failed --output-on-failure
working-directory: build_rel

build-windows-x64-msvc:
name: Windows x64 MSVC
runs-on: windows-2022
Expand All @@ -203,14 +321,14 @@ jobs:
with:
submodules: 'true'

- name: Setup Visual Studio x86_6
- name: Setup Visual Studio x86_64
uses: ilammy/msvc-dev-cmd@v1

- name: Build release
run: |
mkdir build_rel
cd build_rel
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 ..
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 ..
nmake install package
shell: cmd

Expand Down Expand Up @@ -238,6 +356,10 @@ jobs:
python ./Test/astc_test_image.py --test-set Small
shell: cmd

- name: Run unit tests
run: ctest -C Release --rerun-failed --output-on-failure
working-directory: build_rel

build-windows-x64-clangcl:
name: Windows x64 ClangCL
runs-on: windows-2022
Expand All @@ -247,14 +369,14 @@ jobs:
with:
submodules: 'true'

- name: Setup Visual Studio x86_6
- name: Setup Visual Studio x86_64
uses: ilammy/msvc-dev-cmd@v1

- name: Build release
run: |
mkdir build_rel
cd build_rel
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 ..
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 ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
Expand All @@ -264,7 +386,7 @@ jobs:
run: |
mkdir build_dbg
cd build_dbg
cmake -G "Visual Studio 17 2022" -T ClangCL -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON ..
cmake -G "Visual Studio 17 2022" -T ClangCL -DASTCENC_UNITTEST=ON -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON ..
msbuild astcencoder.sln -property:Configuration=Debug
shell: cmd

Expand Down Expand Up @@ -292,6 +414,10 @@ jobs:
python ./Test/astc_test_image.py --test-set Small
shell: cmd

- name: Run unit tests
run: ctest -C Release --rerun-failed --output-on-failure
working-directory: build_rel

build-windows-arm64-clangcl:
name: Windows arm64 ClangCL
runs-on: windows-2022
Expand Down
55 changes: 52 additions & 3 deletions .github/workflows/post_weekly_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,49 @@ jobs:
--auth-key-file ../coverity.key \
--strip-path ${GITHUB_WORKSPACE}
build-ubuntu-arm64:
name: Ubuntu arm64
runs-on: ubuntu-24.04
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Build release
run: |
export CXX=clang++
mkdir build_rel
cd build_rel
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 ..
make install package -j4
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-linux-arm64
path: |
build_rel/*.zip
build_rel/*.zip.sha256
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Run system tests
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
run: |
python ./Test/astc_test_functional.py --encoder neon
python ./Test/astc_test_functional.py --encoder sve_128
python ./Test/astc_test_image.py --encoder neon --test-set Small
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
build-ubuntu-x64:
name: Ubuntu x64
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -100,7 +143,7 @@ jobs:
- name: Run system tests
run: |
python ./Test/astc_test_functional.py
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small
python ./Test/astc_test_image.py --encoder all-x86 --test-set Small
build-macos-universal:
name: macOS universal
Expand Down Expand Up @@ -149,7 +192,7 @@ jobs:
with:
submodules: 'true'

- name: Setup Visual Studio x64
- name: Setup Visual Studio x86_64
uses: ilammy/msvc-dev-cmd@v1

- name: Build release x64
Expand Down Expand Up @@ -287,12 +330,18 @@ jobs:
name: signed-binaries
path: prepare-release

- name: Download Linux binaries
- name: Download Linux x86_64 binaries
uses: actions/download-artifact@v4
with:
name: astcenc-linux-x86_64
path: prepare-release

- name: Download Linux arm64 binaries
uses: actions/download-artifact@v4
with:
name: astcenc-linux-arm64
path: prepare-release

- name: Flatten file structure
run: |
cd prepare-release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Test/Images/Scratch*
# Test output
TestOutput
/*.xlsx
/*.jpg
/*.json
/*.log
/*.txt
Expand Down
3 changes: 3 additions & 0 deletions Docs/ChangeLog-5x.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ header. We always recommend rebuilding your client-side code using the
header from the same release to avoid compatibility issues.

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

0 comments on commit afe3360

Please sign in to comment.