Skip to content

Commit

Permalink
Add more tests to GitHub Actions (#486)
Browse files Browse the repository at this point in the history
This PR updates the GitHub Actions builds:

* Add GCC tests to the Ubuntu test runs for new PRs.
* Add arm64 to the macOS test runs for new PRs.
* Add universal builds to the macOS test runs for new PRs.
* Enable more Small test set quality modes for new PRs.
* Minor cleanups of the YAML to make it a bit easier to read.
  • Loading branch information
solidpixel authored Aug 6, 2024
1 parent e97e799 commit 3d69585
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 101 deletions.
219 changes: 160 additions & 59 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build-test
run-name: Build and test
name: Build and test
run-name: Build and test PR${{ github.event.number }}

on:
workflow_dispatch:
Expand All @@ -8,24 +8,24 @@ on:
- main

jobs:
build-ubuntu:
name: Build and test on Ubuntu
build-ubuntu-x64-clang:
name: Ubuntu x64 Clang
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Build R
- 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_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 D
- name: Build debug
run: |
export CXX=clang++
mkdir build_dbg
Expand All @@ -51,46 +51,131 @@ jobs:
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Python Tests
- name: Run system tests
run: |
python ./Test/astc_test_functional.py --encoder=none
python ./Test/astc_test_functional.py --encoder=sse2
python ./Test/astc_test_functional.py --encoder=sse4.1
python ./Test/astc_test_functional.py --encoder=avx2
python ./Test/astc_test_image.py --encoder=none --test-set Small --test-quality medium
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small --test-quality medium
python ./Test/astc_test_image.py --encoder=none --test-set Small
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small
- name: ctest
- name: Run unit tests
run: ctest
working-directory: build_rel

build-macos:
name: Build and test on MacOS
build-ubuntu-x64-gcc:
name: Ubuntu x64 GCC
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- 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_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
run: |
export CXX=g++
mkdir build_dbg
cd build_dbg
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=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: Python rests
run: |
python ./Test/astc_test_functional.py --encoder=none
python ./Test/astc_test_functional.py --encoder=sse2
python ./Test/astc_test_functional.py --encoder=sse4.1
python ./Test/astc_test_functional.py --encoder=avx2
python ./Test/astc_test_image.py --encoder=none --test-set Small
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small
- name: Run unit tests
run: ctest
working-directory: build_rel

build-macos-x64-clang:
name: macOS x64 Clang
runs-on: macos-12
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Build R
- name: Build release
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 ..
make install package -j4
- name: Build D
- name: Build debug
run: |
mkdir build_dbg
cd build_dbg
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_UNIVERSAL_BUILD=OFF -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=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_image.py --test-set Small
build-macos-universal-clang:
name: macOS universal Clang
runs-on: macos-14
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Build release
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 ..
make install package -j4
- name: Build debug
run: |
mkdir build_dbg
cd build_dbg
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_UNIVERSAL_BUILD=ON ..
make -j4
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-macos-x64
name: astcenc-macos-universal
path: |
build_rel/*.zip
build_rel/*.zip.sha256
Expand All @@ -105,12 +190,12 @@ jobs:
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Python Tests
- name: Run system tests
run: |
python ./Test/astc_test_image.py --test-set Small --test-quality medium
python ./Test/astc_test_image.py --encoder=universal --test-set Small
build-windows-msvc:
name: Build and test on Windows MSVC
build-windows-x64-msvc:
name: Windows x64 MSVC
runs-on: windows-2022
steps:
- name: Git checkout
Expand All @@ -120,27 +205,23 @@ jobs:

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

- 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-cl ..
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 ..
nmake install package
shell: cmd
- name: Build D

- name: Build debug
run: |
mkdir build_dbg
cd build_dbg
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_ISA_NONE=ON ..
nmake
shell: cmd

- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-windows-x64-cl
path: build_rel/*.zip

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -152,13 +233,13 @@ jobs:
pip install numpy Pillow
shell: cmd

- name: Python Tests
- name: Run system tests
run: |
python ./Test/astc_test_image.py --test-set Small --test-quality medium
python ./Test/astc_test_image.py --test-set Small
shell: cmd

build-windows-ClangCL:
name: Build and test on Windows ClangCL
build-windows-x64-clangcl:
name: Windows x64 ClangCL
runs-on: windows-2022
steps:
- name: Git checkout
Expand All @@ -168,48 +249,29 @@ jobs:

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

- 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-clangcl ..
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 ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
shell: cmd
- name: Build D

- name: Build debug
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 ..
msbuild astcencoder.sln -property:Configuration=Debug
shell: cmd

- name: Setup Visual Studio arm64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_arm64
- name: Build R
run: |
mkdir build_rel_arm64
cd build_rel_arm64
cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON -DASTCENC_PACKAGE=arm64-clangcl ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
shell: cmd
- name: Build D
run: |
mkdir build_dbg_arm64
cd build_dbg_arm64
cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON ..
msbuild astcencoder.sln -property:Configuration=Debug
shell: cmd

- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-windows-multi-clangcl
name: astcenc-windows-x64
path: |
build_rel/*.zip
build_rel_arm64/*.zip
Expand All @@ -225,7 +287,46 @@ jobs:
pip install numpy Pillow
shell: cmd

- name: Python Tests
- name: Run system tests
run: |
python ./Test/astc_test_image.py --test-set Small --test-quality medium
python ./Test/astc_test_image.py --test-set Small
shell: cmd

build-windows-arm64-clangcl:
name: Windows arm64 ClangCL
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Setup Visual Studio arm64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_arm64

- name: Build release
run: |
mkdir build_rel
cd build_rel
cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON -DASTCENC_PACKAGE=arm64-clangcl ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
shell: cmd

- name: Build debug
run: |
mkdir build_dbg
cd build_dbg
cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DASTCENC_ISA_NEON=ON ..
msbuild astcencoder.sln -property:Configuration=Debug
shell: cmd

- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-windows-arm64
path: |
build_rel/*.zip
Loading

0 comments on commit 3d69585

Please sign in to comment.