diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index e50e43f941..0000000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 2015-2020 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 -name: KTX-Software Android CI - -# Seems no way to avoid duplicating this on logic in each .yml file. -# See https://github.com/actions/starter-workflows/issues/245. -on: - # Trigger the workflow on a pull request, - pull_request: - - push: - # And on pushes to main, which will occur when a PR is merged. - branches: - - main - # Also trigger on push of release tags to any branch. Useful - # for testing release builds before merging to main. - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - - 'v[0-9]+.[0-9]+.[0-9]+-*' - paths-ignore: - - .appveyor.yml - - .travis.yml - - # Allow manual trigger - workflow_dispatch: - -jobs: - linux: - runs-on: ubuntu-latest - - env: - GIT_LFS_SKIP_SMUDGE: 1 - WERROR: ON - - steps: - - uses: actions/checkout@v4 - with: - # Fetch all history to make sure tags are - # included (used for version creation) - fetch-depth: 0 - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r25c - add-to-path: false - - - name: Force fetch provoking tag's annotation. - # Work around https://github.com/actions/checkout/issues/290. - if: github.ref_type == 'tag' - run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} - - - name: Install Ninja - run: sudo apt-get install -y ninja-build - - - name: android_Debug_arm64-v8a - run: ./ci_scripts/build_android.sh - env: - ANDROID_ABI: arm64-v8a - ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - ASTCENC_ISA: "ASTCENC_ISA_NEON=ON" - CONFIGURATION: Debug - - - name: android_arm64-v8a - run: ./ci_scripts/build_android.sh - env: - ANDROID_ABI: arm64-v8a - ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - ASTCENC_ISA: "ASTCENC_ISA_NEON=ON" - CONFIGURATION: Release - - # Android ABI x86 is obsolete - # and not supported by ARM ASTC encoder - - # - name: android_x86 - # run: ./ci_scripts/build_android.sh - # env: - # ANDROID_ABI: x86 - # ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - - - name: android_x86_64 - run: ./ci_scripts/build_android.sh - env: - ANDROID_ABI: x86_64 - ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - - - name: get-version - id: ktx-version - run: | - KTX_VERSION=$(cat build-android-arm64-v8a/ktx.version) - echo "KTX_VERSION=$KTX_VERSION" >> $GITHUB_ENV - - # Android artifact - # Zips the include and lib dirs installed for each architecture - # by the preceding steps and uploads the zip. - - name: upload artifact - id: upload-artifact - uses: actions/upload-artifact@v4 - with: - name: KTX-Software-${{env.KTX_VERSION}}-Android - path: install-android - - # Make an archive to be deployed. - # Although the preceding step made an archive, Actions helpfully :-( - # unarchives the files on download. - - name: Create zip for deployment. - if: github.event_name == 'push' && github.ref_type == 'tag' - run: | - zip_basename=KTX-Software-${KTX_VERSION}-Android - ln -s install-android $zip_basename - zip -r $zip_basename.zip $zip_basename - sha1sum $zip_basename.zip > $zip_basename.zip.sha1 - - - name: Upload To Release - uses: softprops/action-gh-release@v1 - if: github.event_name == 'push' && github.ref_type == 'tag' - with: - draft: true - prerelease: true - files: KTX-Software-${{env.KTX_VERSION}}-Android.zip* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/check-mkvk.yml b/.github/workflows/check-mkvk.yml deleted file mode 100644 index 1d0271d015..0000000000 --- a/.github/workflows/check-mkvk.yml +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2015-2020 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 -name: KTX-Software Check mkvk CI - -# Seems no way to avoid duplicating this on logic in each .yml file. -# See https://github.com/actions/starter-workflows/issues/245. -on: - # Trigger the workflow on a pull request, - pull_request: - - push: - # And on pushes to main, which will occur when a PR is merged. - branches: - - main - # Also trigger on push of release tags to any branch. Useful - # for testing release builds before merging to main. - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - - 'v[0-9]+.[0-9]+.[0-9]+-*' - paths-ignore: - - .appveyor.yml - - .travis.yml - - # Allow manual trigger - workflow_dispatch: - -jobs: - check-mkvk: - strategy: - matrix: - os: [ macos-latest, ubuntu-latest, windows-latest ] - - runs-on: ${{ matrix.os }} - env: - GIT_LFS_SKIP_SMUDGE: 1 - BUILD_DIR: "build" - WERROR: ON - - steps: - - uses: actions/checkout@v4 - - - name: Clone KTX-Specification repo - run: | - pushd ..; git clone https://github.com/KhronosGroup/KTX-Specification.git; popd - - name: Configure CMake build - run: cmake -B ${{ env.BUILD_DIR }} -DKTX_GENERATE_VK_FILES=ON -DKTX_FEATURE_TESTS=OFF -DKTX_FEATURE_TOOLS=OFF -DKTX_WERROR=${{ env.WERROR }} - - name: Test file generation - run: | - cmake --build ${{ env.BUILD_DIR }} --target mkvk --clean-first - git diff --quiet HEAD - diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml new file mode 100644 index 0000000000..92adfcff84 --- /dev/null +++ b/.github/workflows/lwjgl.yml @@ -0,0 +1,280 @@ +name: LWJGL Build +# The following: +# - fetch-depth: 0 +# - git remote add upstream https://github.com/KhronosGroup/KTX-Software.git +# - git fetch --all --tags +# are required for the build to correctly set the library version. + +on: + push: + branches: + - main + +env: + AWS_DEFAULT_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" + KTX_CMAKE_PARAMS: -DBASISU_SUPPORT_OPENCL=OFF -DKTX_FEATURE_TESTS=OFF -DKTX_FEATURE_TOOLS=OFF + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + container: + image: centos:7 + strategy: + fail-fast: false + matrix: + ARCH: [x64] + include: + - ARCH: x64 + ISA_CMAKE_PARAMS: -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON + defaults: + run: + shell: bash + steps: + - name: Upgrade git + run: | + yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum -y install git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Configure yum + run: | + yum -y install epel-release + yum -y update + - name: Install build dependencies + run: | + yum -y install centos-release-scl + yum -y install devtoolset-11-gcc-c++ + yum -y install cmake3 awscli + - name: Fetch tags + run: | + git config --global --add safe.directory $PWD + git remote add upstream https://github.com/KhronosGroup/KTX-Software.git + git fetch --all --tags + - name: Configure build + run: | + source scl_source enable devtoolset-11 || true + cmake3 -B build $KTX_CMAKE_PARAMS ${{matrix.ISA_CMAKE_PARAMS}} -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + - name: Build + run: | + source scl_source enable devtoolset-11 || true + cmake3 --build build --parallel --target ktx + strip build/libktx.so + - name: Upload artifact + run: aws s3 cp build/libktx.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libktx.so.git + aws s3 cp libktx.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + + linux-cross: + name: Linux Cross + runs-on: ubuntu-latest + container: + image: ${{matrix.CONTAINER}} + strategy: + fail-fast: false + matrix: + ARCH: [arm32, arm64, ppc64le, riscv64] + include: + # ---- + - ARCH: arm32 + CROSS_ARCH: armhf + CONTAINER: ubuntu:18.04 + TRIPLET: arm-linux-gnueabihf + ISA_CMAKE_PARAMS: -DASTCENC_ISA_NEON=OFF -DASTCENC_ISA_NONE=ON + # ---- + - ARCH: arm64 + CROSS_ARCH: arm64 + CONTAINER: ubuntu:18.04 + TRIPLET: aarch64-linux-gnu + ISA_CMAKE_PARAMS: -DASTCENC_ISA_NEON=OFF -DASTCENC_ISA_NONE=ON + # ---- + - ARCH: ppc64le + CROSS_ARCH: ppc64el + CONTAINER: ubuntu:18.04 + TRIPLET: powerpc64le-linux-gnu + ISA_CMAKE_PARAMS: + # ----- + - ARCH: riscv64 + CROSS_ARCH: riscv64 + CONTAINER: ubuntu:20.04 + TRIPLET: riscv64-linux-gnu + ISA_CMAKE_PARAMS: + env: + LWJGL_ARCH: ${{matrix.ARCH}} + defaults: + run: + shell: bash + steps: + - name: Upgrade git + run: | + apt-get -y update + apt-get -y install software-properties-common wget + apt-get -y install --reinstall ca-certificates + apt-get -y update + apt-get -y upgrade + wget https://apt.kitware.com/keys/kitware-archive-latest.asc + apt-key add kitware-archive-latest.asc + add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' + add-apt-repository -y ppa:git-core/ppa + apt-get -y update + DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install dependencies + run: DEBIAN_FRONTEND=noninteractive apt-get -yq install cmake gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross +# - uses: humbletim/setup-vulkan-sdk@v1.2.0 +# with: +# vulkan-query-version: latest +# vulkan-components: Vulkan-Headers, Vulkan-Loader +# vulkan-use-cache: false + - name: Install cross-compilation dependencies for ${{matrix.CROSS_ARCH}} + run: | + sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list + grep "ubuntu.com/ubuntu" /etc/apt/sources.list | tee /etc/apt/sources.list.d/ports.list + sed -i 's/amd64,i386/${{matrix.CROSS_ARCH}}/' /etc/apt/sources.list.d/ports.list + sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list + dpkg --add-architecture ${{matrix.CROSS_ARCH}} + apt-get update || true + - name: Fetch tags + run: | + git config --global --add safe.directory $(pwd) + git remote add upstream https://github.com/KhronosGroup/KTX-Software.git + git fetch --all --tags + - name: Configure build + run: PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${CMAKE_SYSROOT}/usr/lib/${{matrix.TRIPLET}}/pkgconfig CC=${{matrix.TRIPLET}}-gcc CXX=${{matrix.TRIPLET}}-g++ cmake -B build $KTX_CMAKE_PARAMS ${{matrix.ISA_CMAKE_PARAMS}} -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + - name: Build + run: | + cd build + cmake --build . --parallel --target ktx + ${{matrix.TRIPLET}}-strip libktx.so + - name: Upload artifact + run: aws s3 cp build/libktx.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libktx.so.git + aws s3 cp libktx.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + + freebsd-cross: + name: FreeBSD Cross + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Build + uses: cross-platform-actions/action@v0.24.0 + with: + operating_system: freebsd + architecture: x86-64 + version: '13.2' + memory: 4G + shell: bash + environment_variables: KTX_CMAKE_PARAMS + run: | + sudo pkg install -y cmake gmake + cmake -B build $KTX_CMAKE_PARAMS -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + cmake --build build --parallel --target ktx + strip build/libktx.so + - name: Upload artifact + run: | + ls -la build/ + aws s3 cp build/libktx.so s3://lwjgl-build/nightly/freebsd/x64/ $S3_PARAMS + - name: Upload git revision + run: | + git config --global --add safe.directory $PWD + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libktx.so.git + aws s3 cp libktx.so.git s3://lwjgl-build/nightly/freebsd/x64/ $S3_PARAMS + + macos: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + ISA_CMAKE_PARAMS: -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_OSX_ARCHITECTURES=x86_64 + - ARCH: arm64 + ISA_CMAKE_PARAMS: -DASTCENC_ISA_NEON=ON + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 +# - uses: humbletim/setup-vulkan-sdk@v1.2.0 +# with: +# vulkan-query-version: latest +# vulkan-components: Vulkan-Headers, Vulkan-Loader +# vulkan-use-cache: false + - name: Fetch tags + run: | + git remote add upstream https://github.com/KhronosGroup/KTX-Software.git + git fetch --all --tags + - name: Configure build + run: cmake -B build $KTX_CMAKE_PARAMS ${{matrix.CMAKE_PARAMS}} ${{matrix.ISA_CMAKE_PARAMS}} + - name: Build + run: | + cd build + cmake --build . --parallel --target ktx + ls -la + strip -u -r libktx.dylib + - name: Upload artifact + run: aws s3 cp build/libktx.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libktx.dylib.git + aws s3 cp libktx.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + + windows: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + PLATFORM: x64 + ISA_CMAKE_PARAMS: -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON + - ARCH: arm64 + PLATFORM: ARM64 + ISA_CMAKE_PARAMS: -DASTCENC_ISA_NEON=ON -DASTCENC_ISA_NONE=OFF + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 +# - uses: humbletim/setup-vulkan-sdk@v1.2.0 +# with: +# vulkan-query-version: latest +# vulkan-components: Vulkan-Headers, Vulkan-Loader +# vulkan-use-cache: false + - name: Fetch tags + run: | + git remote add upstream https://github.com/KhronosGroup/KTX-Software.git + git fetch --all --tags + - name: Configure build + run: cmake . -B build -G "Visual Studio 17 2022" -A ${{matrix.PLATFORM}} %KTX_CMAKE_PARAMS% ${{matrix.ISA_CMAKE_PARAMS}} + - name: Build + run: | + cd build + cmake --build . --config Release --parallel --target ktx + - name: Upload artifact + run: aws s3 cp build\Release\ktx.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ %S3_PARAMS% + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > ktx.dll.git + aws s3 cp ktx.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ %S3_PARAMS% diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml deleted file mode 100644 index a13cb42984..0000000000 --- a/.github/workflows/mingw.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2015-2020 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 -name: KTX-Software MingW CI - -# Seems no way to avoid duplicating this on logic in each .yml file. -# See https://github.com/actions/starter-workflows/issues/245. -on: - # Trigger the workflow on a pull request, - pull_request: - - push: - # And on pushes to main, which will occur when a PR is merged. - branches: - - main - # Also trigger on push of release tags to any branch. Useful - # for testing release builds before merging to main. - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - - 'v[0-9]+.[0-9]+.[0-9]+-*' - paths-ignore: - - .appveyor.yml - - .travis.yml - - # Allow manual trigger - workflow_dispatch: - -jobs: - mingw: - runs-on: windows-latest - defaults: - run: - shell: bash - env: - GIT_LFS_SKIP_SMUDGE: 1 - WERROR: ON - - steps: - - uses: actions/checkout@v4 - with: - # Fetch all history to make sure tags are - # included (used for version creation) - fetch-depth: 0 - - name: GCC Version - run: gcc --version # If this fails MINGW is not setup correctly - - name: Force update provoking tag - # Work around https://github.com/actions/checkout/issues/290. - if: github.ref_type == 'tag' - run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} - - name: Pull test images from Git LFS - run: git lfs pull --include=tests/srcimages,tests/testimages - - name: Fetch CTS Submodule - run: git submodule update --init --recursive tests/cts - - name: Install Ninja - run: choco install ninja --no-progress - - name: Configure Mingw x64 - run: cmake -B build -G "Ninja Multi-Config" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DKTX_FEATURE_TOOLS=TRUE -DKTX_FEATURE_TOOLS_CTS=TRUE -DKTX_WERROR=$WERROR - - name: Build Mingw x64 Debug - run: cmake --build build --config Debug - - name: Build Mingw x64 Release - run: cmake --build build --config Release - - name: Test Mingw build - run: ctest --output-on-failure --test-dir build -C Release - - name: Upload test log - shell: pwsh - if: ${{ failure() }} - run: ci_scripts/on_failure.ps1 diff --git a/.github/workflows/publish-pyktx.yml b/.github/workflows/publish-pyktx.yml deleted file mode 100644 index a593e23b1e..0000000000 --- a/.github/workflows/publish-pyktx.yml +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 2023 Shukant Pal -# SPDX-License-Identifier: Apache-2.0 - -name: Publish Python 🐍 distribution 📦 to PyPI or TestPyPI - -# https://github.com/pypa/gh-action-pypi-publish strongly recommends a -# separate publishing job when building platform-specific distribution -# packages, hence this. -# -# This should not be run until the release artifacts have been deployed. -# The only way I can see to trigger this automatically is to have all -# platform builds in a single workflow file and use on: `workflow_run` -# so this is triggered when that workflow completes. Once all platform -# builds are moved to GitHub Actions we can try making each platform -# workflow reusable and making another workflow that calls each of -# them via `uses` and use `on: workflow_run` here. -# -# We also have to figure out how to determine if the workflow deployed -# to releases. Maybe can use the GitHub REST API to get an artifact -# from the triggering workflow that is set only when deploying -# releases. See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow. -# Alternatively maybe there is some way of querying what triggered -# the workflow that we can test in an `if:` in the job as noted below. - -on: - workflow_dispatch: - inputs: -# repository-url: -# description: 'destination repository' -# required: true -# default: 'https://pypi.org' -# type: choice -# options: -# - https://test.pypi.org -# - https://pypi.org - test-pypi: - type: boolean - description: 'Deploy to test pypi registry' - required: true - default: false - prerelease: - type: boolean - description: 'Deploy pre-release' - required: false - default: false - -# Example to try in future. -# workflow_run: -# workflows: [KTX-Software Build All] -# types: -# - completed -# An unknown is how to limit the trigger to when deploy is run in -# Windows CI which is happens when that workflow is triggered by -# a push with the tags below. -# push: -# # Trigger on push of release tags. There is no way to limit the trigger -# # to a specific branch. A later build step checks for the main branch. -# tags: -# - 'v[0-9]+\.[0-9]+\.[0-9]+' -# - 'v[0-9]+\.[0-9]+\.[0-9]+-*' - -env: - GIT_LFS_SKIP_SMUDGE: 1 - INPUT_PRERELEASE: ${{ inputs.prerelease }} - -jobs: - publish-to-pypi: - name: Publish Python 🐍 distribution 📦 to PyPI - if: ${{ ! inputs.test-pypi }} - runs-on: ubuntu-latest -# environment: -# name: pypi -# url: https://pypi.org/p/pyktx -# permissions: -# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - # When using workflow_run it is necessary to check for successful - # completion of the workflow with - #if: ${{ github.event.workflow_run.conclusion == 'success' }} - # Maybe it is possible to test for a release tag here too. - steps: - - uses: actions/checkout@v4 - - - name: Set up .netrc - env: - GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} - run: echo -e "machine api.github.com login $GH_API_TOKEN" >> ~/.netrc - - name: Download pyktx assets from latest (pre-)release - run: | - echo INPUT_PRERELEASE = $INPUT_PRERELEASE - if [ "$INPUT_PRERELEASE" = "true" ]; then - option="--pre-release" - else - option= - fi - # Omit linux packages since PyPI won't accept them and, at the - # moment, we don't have a workflow to build manylinux wheels, which - # it will accept. It's non-trivial to implement that. See - # https://github.com/pypa/manylinux?tab=readme-ov-file#docker-images - ci_scripts/download_release_assets.sh $option --filter '(?:^pyktx)(?!.*linux.*)' --output-dir dist - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - - publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI - if: ${{ inputs.test-pypi }} - runs-on: ubuntu-latest -# environment: -# name: testpypi -# url: https://pypi.org/p/pyktx -# permissions: -# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - # When using workflow_run it is necessary to check for successful - # completion of the workflow with - #if: ${{ github.event.workflow_run.conclusion == 'success' }} - # Maybe it is possible to test for a release tag here too. - steps: - - uses: actions/checkout@v4 - - - name: Set up .netrc - env: - GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} - run: echo -e "machine api.github.com login $GH_API_TOKEN" >> ~/.netrc - - name: Download pyktx assets from latest (pre-)release - run: | - echo INPUT_PRERELEASE = $INPUT_PRERELEASE - if [ "$INPUT_PRERELEASE" = "true" ]; then - option="--pre-release" - else - option= - fi - ci_scripts/download_release_assets.sh $option --filter '(?:^pyktx)(?!.*linux.*)' --output-dir dist - - name: Publish distribution 📦 to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - password: ${{ secrets.TESTPYPI_API_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index f6917b4cba..0000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright 2015-2020 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 -name: KTX-Software Windows CI - -# Seems no way to avoid duplicating this on logic in each .yml file. -# See https://github.com/actions/starter-workflows/issues/245. -on: - # Trigger the workflow on a pull request, - pull_request: - - push: - # And on pushes to main, which will occur when a PR is merged. - branches: - - main - # Also trigger on push of release tags to any branch. Useful - # for testing release builds before merging to main. - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - - 'v[0-9]+.[0-9]+.[0-9]+-*' - paths-ignore: - - .appveyor.yml - - .travis.yml - - # Allow manual trigger - workflow_dispatch: - -jobs: - windows: - strategy: - matrix: - os: [ windows-latest ] - toolset: [v143, CLangCL] - arch: [ x64 ] - check_mkvk: [ NO ] - options: [ - {config: 'Debug,Release', - doc: ON, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tests: ON, tools: ON, tools_cts: ON, - package: YES, - sse: ON, opencl: OFF}, - {config: Release, - doc: OFF, loadtests: OFF, py: OFF, tests: OFF, tools: OFF, tools_cts: OFF, - package: NO, - sse: OFF, opencl: OFF}, - {config: Release, - doc: OFF, loadtests: OFF, py: OFF, tests: OFF, tools: OFF, tools_cts: OFF, - package: NO, - sse: OFF, opencl: ON}, - {config: Release, - doc: OFF, loadtests: OFF, py: OFF, tests: OFF, tools: OFF, tools_cts: OFF, - package: NO, - sse: ON, opencl: ON} - ] - include: - - os: windows-2019 - generator: 'Visual Studio 16 2019' - toolset: v142 - arch: x64 - options: { - config: 'Debug,Release', - doc: ON, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tests: ON, tools: ON, tools_cts: ON, - package: NO, - sse: ON, opencl: OFF - } - - os: windows-latest - generator: 'Visual Studio 17 2022' - toolset: CLangCL - arch: arm64 - options: { - config: 'Debug,Release', - doc: ON, jni: ON, loadtests: OpenGL, py: OFF, tests: ON, tools: ON, tools_cts: ON, - package: YES - } - runs-on: ${{ matrix.os }} - env: - # Skip downloading necessities for the load tests and source and golden - # images for the other tests since we can't run arm64 tests on the x64 - # build host. - GIT_LFS_SKIP_SMUDGE: 1 - - BUILD_DIR: "build" - - CMAKE_GEN: ${{ matrix.generator }} - CMAKE_TOOLSET: ${{ matrix.toolset }} - - ARCH: ${{ matrix.arch }} - CHECK_MKVK: ${{ matrix.check_mkvk }} - CONFIGURATION: ${{ matrix.options.config }} - FEATURE_DOC: ${{ matrix.options.doc }} - FEATURE_JNI: ${{ matrix.options.jni }} - FEATURE_LOADTESTS: ${{ matrix.options.loadtests }} - FEATURE_PY: ${{ matrix.options.py }} - FEATURE_TESTS: ${{ matrix.options.tests }} - FEATURE_TOOLS: ${{ matrix.options.tools }} - FEATURE_TOOLS_CTS: ${{ matrix.options.tools_cts }} - PACKAGE: ${{ matrix.options.package }} - SUPPORT_OPENCL: ${{ matrix.options.opencl }} - SUPPORT_SSE: ${{ matrix.options.sse }} - WERROR: ON - - CODE_SIGN_TIMESTAMP_URL: "http://timestamp.digicert.com" - AZURE_KEY_VAULT_URL: ${{ secrets.AZURE_KEY_VAULT_URL }} - AZURE_KEY_VAULT_CERTIFICATE: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE }} - AZURE_KEY_VAULT_CLIENT_ID: ${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }} - AZURE_KEY_VAULT_CLIENT_SECRET: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }} - AZURE_KEY_VAULT_TENANT_ID: ${{ secrets.AZURE_KEY_VAULT_TENANT_ID }} - - OPENCL_SDK_HOME: https://github.com/intel/llvm/releases/download/2021-09 - OPENCL_SDK_NAME: win-oclcpuexp-2021.12.9.0.24_rel - OPENGL_ES_EMULATOR: C:/Imagination/Windows_x86_64 - OPENGL_ES_EMULATOR_WIN: C:\Imagination\Windows_x86_64 - PVR_SDK_HOME: https://github.com/powervr-graphics/Native_SDK/raw/master/lib/Windows_x86_64/ - PYTHON: C:\hostedtoolcache\windows\Python\3.11.4\x64\python.exe - # This is set to avoid the compiler running out of heap space - # when vcpkg is compiling glew. Default is logical cores + 1. - # Runners have 1 thread per core and 2 cores. - VCPKG_MAX_CONCURRENCY: 2 - VULKAN_SDK_VER: 1.3.243.0 - - steps: - - uses: actions/checkout@v4 - with: - # Fetch all history to make sure tags are - # included (used for version creation) - fetch-depth: 0 - - - name: Install NSIS with large string support - if: matrix.check_mkvk != 'ONLY' - shell: bash - run: | - retryCount=4 - success=0 - for i in $(seq $retryCount) ; do - echo "Attempt no: $i" - stack exec -- wget -O nsis-3.08-strlen_8192.zip https://downloads.sourceforge.net/nsis/NSIS%203/3.08/nsis-3.08-strlen_8192.zip - if [[ $? -eq 0 ]] ; then - success=1 - 7z x -aoa -o"/c/Program Files (x86)/NSIS" nsis-3.08-strlen_8192.zip - rm nsis-3.08-strlen_8192.zip - echo "Installation successful." - break - else - echo "Installation failed. Retrying..." - sleep $(( 2*$i )) - fi - done - if (( ! $success )) ; then - echo "Installation failed after $retryCount attempts." - exit 1 - fi - - - name: Force fetch provoking tag's annotation. - # Work around https://github.com/actions/checkout/issues/290. - if: github.ref_type == 'tag' && matrix.check_mkvk != 'ONLY' - run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} - - # Need doxygen if docs are supposed to be built. - # Note this suffers frequent failures due to Chocolatey attempts - # to blackmail you into purchasing a license. Hence we retry a - # few times. If this still fails, re-run the build. - - name: Install Doxygen - if: matrix.options.doc == 'ON' - #run: choco install doxygen.install - run: | - $retryCount = 4 - $success = $false - for ($i = 1; $i -le $retryCount; $i++) { - Write-Host "Attempt no: $i" - choco install doxygen.install --no-progress - if ($LASTEXITCODE -eq 0) { - $success = $true - Write-Host "Installation successful." - break - } else { - Write-Host "Installation failed. Retrying..." - Start-Sleep -Seconds (2*$i) - } - } - if (-not $success) { - Write-Host "Installation failed after $retryCount attempts." - exit 1 - } - - - name: Install AzureSignTool - if: matrix.check_mkvk != 'ONLY' - id: install-ast - run: | - if ($env:PACKAGE -eq "YES" -and $env:AZURE_KEY_VAULT_URL) { - dotnet tool install --global AzureSignTool - echo "CODE_SIGN_KEY_VAULT=Azure" >> $env:GITHUB_ENV - } - - - name: Install Dependencies for load tests on arm64 - if: matrix.arch == 'arm64' && matrix.options.loadtests != 'OFF' - run: | - pushd $env:VCPKG_INSTALLATION_ROOT - ./vcpkg install SDL2:arm64-windows assimp:arm64-windows glew:arm64-windows - cat buildtrees\glew\install-arm64-windows-rel-out.log - popd - echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV - echo "LOADTESTS_USE_LOCAL_DEPENDENCIES=ON" >> $env:GITHUB_ENV - - - name: Install Dependencies - if: matrix.check_mkvk != 'ONLY' - # This script only installs what's needed by ON FEATUREs. - run: ci_scripts/install_win.ps1 - - - name: Set up JDK 17. - if: matrix.options.jni == 'ON' && matrix.check_mkvk != 'ONLY' - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Set up Python 3.11 - if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' - uses: actions/setup-python@v5 - with: - python-version: '3.11.4' - - - name: Smudge embedded dates - if: matrix.options.doc == 'ON' - run: | - ./install-gitconfig.ps1 - ci_scripts/smudge_date.ps1 - - - name: Build Windows - if: matrix.check_mkvk != 'ONLY' - # The installers run as part of "Install Dependencies" add - # environment variables to the registry and augment $Path there. - # Although each step gets a new Powershell instance, that instance - # is spawned from some parent Powershell so it does not pick up - # the changes from the registry. Use Chocolatey's helper to - # pull in the changes. - # After import, `refreshenv` is an alias for - # Update-SessionEnvironment. Without the import refreshenv will end - # up calling the cmd.exe version, which won't help Powershell, and - # Update-SessionEnvironment will not exist. - # Unfortunately this resets JAVA_HOME to whatever is in the registry. - # The one from the Set Up JDK step was set in the environment before - # this step is called. - run: | - $step_java_home=$env:JAVA_HOME - Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1" - refreshenv - $env:JAVA_HOME=$step_java_home - ci_scripts/build_win.ps1 - - - name: Test Generation of VkFormat-related files - if: matrix.check_mkvk == 'ONLY' - run: ci_scripts/check_mkvk.ps1 - - - name: Test Windows build - # Tests built for arm64 can't be run as the CI runners are all x64. - if: matrix.arch == 'x64' && matrix.options.tests == 'ON' - run: ctest --output-on-failure --test-dir $env:BUILD_DIR -C Release - - - name: Upload test log - if: ${{ failure() }} - run: ci_scripts/on_failure.ps1 - - - name: Get KTX version - if: matrix.options.package == 'YES' - id: ktx-version - run: | - $KTX_VERSION = Get-Content $env:BUILD_DIR/ktx.version - echo "KTX_VERSION=$KTX_VERSION" >> $env:GITHUB_ENV - - - name: Upload Artifact - if: matrix.options.package == 'YES' && matrix.toolset == 'CLangCL' - uses: actions/upload-artifact@v4 - with: - name: KTX-Software-${{env.KTX_VERSION}}-Windows-${{matrix.arch}} - path: ${{env.BUILD_DIR}}/KTX-Software-*.exe* - - - name: Upload pyktx artifacts - if: matrix.options.package == 'YES' && matrix.options.py == 'ON' - uses: kittaakos/upload-artifact-as-is@v0 - with: - path: ${{env.BUILD_DIR}}/interface/python_binding/dist/ - - - name: Upload to Release - uses: softprops/action-gh-release@v1 - if: matrix.options.package == 'YES' && matrix.toolset == 'CLangCL' && github.event_name == 'push' && github.ref_type == 'tag' - with: - draft: true - prerelease: true - files: | - ${{env.BUILD_DIR}}/KTX-Software-*.exe* - ${{env.BUILD_DIR}}/interface/python_binding/dist/pyktx-* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/lib/astc-encoder/Source/cmake_core.cmake b/lib/astc-encoder/Source/cmake_core.cmake index eec1f45944..1b8cba2143 100644 --- a/lib/astc-encoder/Source/cmake_core.cmake +++ b/lib/astc-encoder/Source/cmake_core.cmake @@ -190,6 +190,10 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER) $<${is_gnu_fe}:-Wno-reserved-identifier> $<${is_gnu_fe}:-Wno-cast-function-type> + # LWJGL: GCC bugs on 18.04 + $<${is_gnu_fe}:-Wno-strict-overflow> + $<${is_gnu_fe}:-Wno-attributes> + # Force DWARF4 for Valgrind profiling $<$,${is_clang}>:-gdwarf-4>