初始化内容

This commit is contained in:
2026-09-16 14:07:40 +08:00
parent 6934b390bf
commit 4f643c1e7c
18350 changed files with 6088489 additions and 305 deletions
+143
View File
@@ -0,0 +1,143 @@
# 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
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/mingw.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
- vcpkg.json
- vcpkg-configuration.json
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
linux:
runs-on: ubuntu-latest
permissions:
contents: write
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: ./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: ./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: ./scripts/build_android.sh
# env:
# ANDROID_ABI: x86
# ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: android_x86_64
run: ./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@v2
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 }}
+66
View File
@@ -0,0 +1,66 @@
# 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
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/mingw.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
- vcpkg.json
- vcpkg-configuration.json
# 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
+36
View File
@@ -0,0 +1,36 @@
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software Check reuse 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]+-*'
# Allow manual trigger
workflow_dispatch:
jobs:
check-reuse:
runs-on: ubuntu-latest
env:
GIT_LFS_SKIP_SMUDGE: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v5
+150
View File
@@ -0,0 +1,150 @@
# Copyright 2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: Build and Deploy Reference Pages and Other Documentation
# Ensure documentation builds on all platforms. Deploy from the Ubuntu build.
#
# The plan is for this to be used to build the docs on all platforms for
# PRs and pushes to main and remove those builds from the platform software
# builds. On release tags though the platform software builsd will have to
# build the documentation so it can be included in the release package.
# Due to a tight deadline for 4.4 there is no time to modify the platform
# software builds to build docs only on release tags so they continue to
# build for PRs and pushes to main. Therefore all but the Ubuntu build have
# been disabled here for now.
# The ubuntu build is used to deploy the docs to GitHub Pages on a release
# build. The plan, once the destination is set up, is to use this workflow
# to deploy the docs for a release to a location on khronos.org and docs
# for any pushes to main to GitHub Pages.
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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/formatting.yml
- .github/workflows/mingw.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- vcpkg.json
- vcpkg-configuration.json
# Allow manual trigger
workflow_dispatch:
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
build-docs:
name: Build KTX-Software reference pages and documentation
strategy:
matrix:
#os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
env:
BUILD_DIR: build
steps:
- uses: actions/checkout@v4
with:
# Fetch all history to make sure tags are
# included (used for version creation)
fetch-depth: 0
- 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: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11.4'
# virtualenv is no longer included as of 20240929.1 runner so
# install it ourselves. See
# https://github.com/actions/runner-images/issues/10749.
#
# Note that it is the builds of sdist and wheel that require virtualenv
# not the explicit dependencies of pyktx.
- name: Install Python virtualenv
run: pip install virtualenv
- name: Install Doxygen
uses: ssciwr/doxygen-install@v1
- name: Install Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Smudge dates (macOS and Ubuntu)
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: ./install-gitconfig.sh && scripts/smudge_date.sh
- name: Smudge dates (Windows)
if: matrix.os == 'windows-latest'
run: ./install-gitconfig.ps1 && scripts/smudge_date.ps1
- name: Build docs
run: |
echo "Doxygen version: $(doxygen --version)"
cmake -B ${{ env.BUILD_DIR }} -D KTX_FEATURE_DOC=ON -D KTX_FEATURE_PY=ON -D KTX_FEATURE_TESTS=OFF -D KTX_FEATURE_TOOLS=OFF
cmake --build ${{ env.BUILD_DIR }} --target all.doc
- name: Upload generated HTML documentation for GitHub Pages
if: matrix.os == 'ubuntu-latest'
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.BUILD_DIR }}/docs/html
deploy:
name: Deploy to GitHub Pages
# Add a dependency to the build job
needs: build-docs
# Only deploy when building `main`.
# if: github.ref == 'refs/heads/main'
# Only deploy when building for a release tag. Note that filtering in
# on: means the only tags the workflow runs for are release tags.
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify deployment step
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
+23
View File
@@ -0,0 +1,23 @@
# Copyright 2024 The Khronos Group Inc.
# Copyright 2024 RasterGrid Kft.
# SPDX-License-Identifier: Apache-2.0
name: Formatting
on:
workflow_call:
permissions:
contents: read
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '17'
+340
View File
@@ -0,0 +1,340 @@
# Copyright 2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software Linux 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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
#formatting:
# uses: ./.github/workflows/formatting.yml
linux:
permissions:
packages: write
contents: write
# Shortcircuit and don't burn CI time when formatting will reject
#needs: formatting
strategy:
matrix:
include:
- name: Default
os: ubuntu-latest
generator: Ninja
arch: x86_64
compiler: gcc
vk_sdk_ver: '1.4.313'
options: {
config: Debug,
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: ON,
sse: ON, opencl: OFF
}
- name: Clang
os: ubuntu-latest
generator: Ninja Multi-Config
arch: x86_64
compiler: clang
vk_sdk_ver: '1.4.313'
options: {
config: 'Debug,Release',
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: OFF,
sse: ON, opencl: OFF
}
- name: Package (x86_64)
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: gcc
vk_sdk_ver: '1.4.313'
#vcpkg_install_options: --debug
options: {
config: Release,
doc: ON, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: ON,
package: YES, sse: ON, opencl: OFF
}
- name: Package (aarch64)
os: ubuntu-22.04-arm
generator: Ninja
arch: aarch64
compiler: gcc
vk_sdk_ver: '1.4.313'
#vcpkg_install_options: --debug
options: {
config: Release,
doc: ON, jni: ON, loadtests: OpenGL, py: ON, tools: ON, tools_cts: ON,
package: YES, sse: OFF, opencl: OFF
}
- name: OpenCL,SSE
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: gcc
vk_sdk_ver: '1.4.313'
options: {
config: Release,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: ON, opencl: ON
}
- name: OpenCL
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: gcc
vk_sdk_ver: '1.4.313'
options: {
config: Release,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: OFF, opencl: ON
}
- name: All OFF
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: gcc
vk_sdk_ver: '1.4.313'
options: {
config: Release,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: OFF, opencl: OFF
}
name: ${{ matrix.name && matrix.name || format('{0} SSE,OpenCL:{1},{2}', matrix.os, matrix.options.sse, matrix.options.opencl) }}
runs-on: ${{ matrix.os }}
env:
# To avoid bandwidth charges skip downloading source and golden images
# for texturetests etc., loadtests and legacy tool tests. They will be
# pulled later as necessary
GIT_LFS_SKIP_SMUDGE: 1
BUILD_DIR: build
REL_DESC_FILE: "build/rel_desc.md"
# Map test matrix elements to environmental variables, so that scripts launched from CI scripts may react to them.
# Some matrix variables have defaults if unspecified by the matrix
CMAKE_GEN: ${{ matrix.generator }}
ARCH: ${{ matrix.arch }}
CONFIGURATION: ${{ matrix.options.config }}
PLATFORM: ${{ matrix.options.platform }}
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 && matrix.options.tests || 'ON' }}
FEATURE_TOOLS: ${{ matrix.options.tools }}
FEATURE_TOOLS_CTS: ${{ matrix.options.tools_cts }}
PACKAGE: ${{ matrix.options.package && matrix.options.package || 'NO' }}
SUPPORT_OPENCL: ${{ matrix.options.opencl }}
SUPPORT_SSE: ${{ matrix.options.sse }}
PY_USE_VENV: ${{ matrix.options.py.use_venv && matrix.options.py_use_venv || 'OFF' }}
WERROR: ${{ matrix.options.werror && matrix.options.werror || 'ON' }}
# CC Handled by job step
# CXX Handled by job step
PYTHON_DIST_DIR: interface/python_binding/dist
VCPKG_INSTALL_OPTIONS: ${{ matrix.vcpkg_install_options && matrix.vcpkg_install_options || '' }}
VULKAN_SDK_VER: ${{ matrix.vk_sdk_ver }}
steps:
- uses: actions/checkout@v4
with:
# Fetch all history to make sure tags are
# included (used for version creation)
fetch-depth: 0
- name: Set compiler
if: matrix.compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
elif [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "Unknown compiler toolchain set"
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 }}
- name: before_install
run: |
echo -n "Running on the following GitHub Actions CI runner: " && uname -a
echo -n "CMake version on the runner is " && cmake --version
sudo apt-get update
- name: install
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
./scripts/install_linux.sh
- name: Install libldtl and mono
if: matrix.options.loadtests != 'OFF' && (matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest')
# These packages were omitted from ubuntu-24.04 for some reason.
# libldtl is needed by libxcrypt which is needed by vcpkg.
# mono is needed for adding NuGet sources for caching.
run: sudo apt-get install mono-complete libltdl-dev
# Should a specific version of Python ever be wanted, use this.
# - name: Set up Python
# if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
# uses: actions/setup-python@v5
# with:
# python-version: '3.13'
# If the selected Python does not have virtualenv installed, use this.
#
# Note that the builds, via sdist and wheel, require a virtual env.
# regardless of whether the in-use Python is externally managed.
# Installing the explicit dependencies of pyktx only needs virtualenv
# and PY_USE_VENV: ON when Python is externally managed.
# - name: Install Python virtualenv
# if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
# run: pip install virtualenv
- name: before_script
run: |
if [ "$FEATURE_TOOLS_CTS" = "ON" ]; then
git submodule update --init --recursive tests/cts
fi
if [ "$FEATURE_TESTS" = "ON" ]; then
git lfs pull --include=tests/srcimages,tests/testimage
fi
# Make sure embedded dates are correct.
./install-gitconfig.sh
scripts/smudge_date.sh
- name: Export environment variables for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
# actions/github-script is used primarily because it is the only
# way to access VCPKG_INSTALLATION_ROOT outside of the runner's shell.
# Maintaining cross-platform access is desirable so the code can be
# easily copied to a multi-platform workflow. NUGET_FEED_URL is set
# here to keep the vcpkg cache environment variables together.
uses: actions/github-script@v7
with:
# JSON in use here. #<comments> in the script will break it.
# Pre-installed vcpkg location is indicated by a non-standard env.
# var.
script: |
core.exportVariable('VCPKG_ROOT', process.env.VCPKG_INSTALLATION_ROOT || '');
core.exportVariable('VCPKG_EXE', process.env.VCPKG_INSTALLATION_ROOT + '/vcpkg' || '');
core.exportVariable('NUGET_FEED_URL', 'https://nuget.pkg.github.com/KhronosGroup/index.json' || '');
- name: Overwrite /usr/bin/mono
# nuget downloaded by vcpkg fetch on aarch64 is a shell script. This
# prevents vcpkg from trying and failing, to run it in mono. This is
# my ugliest hack in 45 years of software development.
if: matrix.options.loadtests != 'OFF' && matrix.arch == 'aarch64'
run: sudo sh -c "mv /usr/bin/mono /usr/bin/mono-real && echo '#! /usr/bin/env bash\nif [ \"\$1\" = \"/usr/bin/nuget\" ]; then \$*; else /usr/bin/mono-real \$*; fi' > /usr/bin/mono && chmod 755 /usr/bin/mono"
- name: Add NuGet sources for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
env:
USERNAME: KhronosGroup
shell: bash
# `vcpkg fetch nuget` fetches nuget and outputs the location of
# the fetched command. It is a .exe that runs in the mono VM.
run: |
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
sources add \
-Source "${{ env.NUGET_FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${{ env.NUGET_FEED_URL }}"
- name: script
env:
VCPKG_BINARY_SOURCES: clear;nuget,${{ env.NUGET_FEED_URL }},readwrite
run: |
./scripts/build_linux.sh
- name: Sanitize release notes
if: matrix.options.package == 'YES' && github.event_name == 'push' && github.ref_type == 'tag'
run: |
if [ ! -f $REL_DESC_FILE -a -f RELEASE_NOTES.md ]; then
# Remove lines that are unnecessary in the context of a GitHub
# release description.
awk '/^Release Notes/,/^## Version/ { next }
! /<!-- Copyright/ && ! /<!-- SPDX/ { print }' RELEASE_NOTES.md \
> $REL_DESC_FILE
fi
- name: Prepare KTX artifacts
if: matrix.options.package == 'YES'
id: ktx-version
run: |
KTX_VERSION=`cat $BUILD_DIR/ktx.version`
echo "PACKAGE_NAME_SUFFIX=${KTX_VERSION}-${{runner.os}}-${{matrix.arch}}" >> $GITHUB_ENV
# For these artifact uploads, need to take care that only one CLangCL
# "package" job for each architecture produces artifacts. A second
# job would attempt to upload a same-named artifact.
- name: Upload artifact Install Package
if: matrix.options.package == 'YES'
uses: actions/upload-artifact@v4
with:
name: KTX-Software-${{env.PACKAGE_NAME_SUFFIX}}
path: ${{env.BUILD_DIR}}/KTX-Software-*-*
compression-level: 0 # Installer already compressed.
- name: Upload artifact pyktx
if: matrix.options.package == 'YES' && matrix.options.py == 'ON'
uses: actions/upload-artifact@v4
with:
name: pyktx-${{env.PACKAGE_NAME_SUFFIX}}
path: ${{env.BUILD_DIR}}/${{env.PYTHON_DIST_DIR}}
- name: Upload to Release
uses: softprops/action-gh-release@v2
if: matrix.options.package == 'YES' && github.event_name == 'push' && github.ref_type == 'tag'
with:
draft: true
prerelease: true
files: |
${{env.BUILD_DIR}}/KTX-Software-*-*
${{env.BUILD_DIR}}/${{env.PYTHON_DIST_DIR}}/pyktx-*
body_path: ${{env.REL_DESC_FILE}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+310
View File
@@ -0,0 +1,310 @@
# Copyright 2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software macOS & iOS 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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
#formatting:
# uses: ./.github/workflows/formatting.yml
macos:
permissions:
packages: write
contents: write
# Shortcircuit and don't burn CI time when formatting will reject
#needs: formatting
strategy:
matrix:
os: [ macos-latest, macos-14 ]
generator: [ Xcode ]
arch: [ arm64, x86_64 ]
vulkan_sdk_version: ['1.4.313.1']
options: [
{config: 'Debug,Release', platform: macOS,
doc: ON, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: ON,
package: YES, sse: ON, opencl: OFF},
{config: Release, platform: macOS,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: ON, opencl: ON},
{config: Release, platform: macOS,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: OFF, opencl: ON},
{config: Release, platform: macOS,
doc: OFF, jni: OFF, loadtests: OFF, py: OFF, tools: OFF, tools_cts: OFF,
sse: OFF, opencl: OFF}
]
include:
- name: Test macOS 13 build
os: macos-13
options: {
# graphviz no longer supports macOS 13 so doc: OFF.
# ts-graphviz/setup-graphviz@v2 does not support specifying a
# version on macOS.
config: 'Debug,Release', platform: macOS,
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tests: OFF, tools: ON, tools_cts: OFF,
package: OFF, sse: ON, opencl: OFF
}
- name: Build for iOS
os: macos-latest
generator: Xcode
arch: arm64
options: {
config: Release, platform: iOS,
doc: OFF, jni: OFF, loadtests: OpenGL+Vulkan, py: OFF, tests: OFF, tools: OFF, tools_cts: OFF,
package: YES, sse: OFF, opencl: OFF
}
# ': ' within the format string causes a "mapping values are not
# allowed in this context" YAML syntax error. Replacement {1} is
# a workaround.
name: ${{ matrix.name && matrix.name || format('{0} ({1}) Package,SSE,OpenCL:{2}{3},{4},{5}', matrix.os, matrix.arch, ' ', matrix.options.package && matrix.options.package || 'NO', matrix.options.sse, matrix.options.opencl) }}
runs-on: ${{ matrix.os }}
env:
# To avoid bandwidth charges skip downloading source and golden images
# for texturetests etc., loadtests and legacy tool tests. They will be
# pulled later as necessary
GIT_LFS_SKIP_SMUDGE: 1
HOMEBREW_NO_AUTO_UPDATE: 1
APPLE_ID: ${{ secrets.APPLE_ID }}
DEVELOPMENT_TEAM: ${{ secrets.APPLE_DEVELOPMENT_TEAM }}
PKG_SIGN_IDENTITY: ${{ secrets.APPLE_PKG_SIGN_IDENTITY }}
CODE_SIGN_IDENTITY: ${{ secrets.APPLE_CODE_SIGN_IDENTITY }}
BUILD_DIR: build
REL_DESC_FILE: "build/rel_desc.md"
# Map test matrix elements to environmental variables, so that scripts launched from CI scripts may react to them.
# Some matrix variables have defaults if unspecified by the matrix
CMAKE_GEN: ${{ matrix.generator }}
ARCH: ${{ matrix.arch }} # iOS uses ARCH
ARCHS: ${{ matrix.arch }} # MacOS uses ARCHS
CONFIGURATION: ${{ matrix.options.config }}
PLATFORM: ${{ matrix.options.platform }}
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 && matrix.options.tests || 'ON' }}
FEATURE_TOOLS: ${{ matrix.options.tools }}
FEATURE_TOOLS_CTS: ${{ matrix.options.tools_cts }}
PACKAGE: ${{ matrix.options.package && matrix.options.package || 'NO' }}
SUPPORT_OPENCL: ${{ matrix.options.opencl }}
SUPPORT_SSE: ${{ matrix.options.sse }}
WASM_BUILD: ${{ matrix.options.wasm && matrix.options.wasm || 'OFF' }}
# Virtual env (ON) is needed because pre-installed python is "externally managed."
PY_USE_VENV: ${{ matrix.options.py.use_venv && matrix.options.py_use_venv || 'ON' }}
WERROR: ${{ matrix.options.werror && matrix.options.werror || 'ON' }}
# CC Handled by job step
# CXX Handled by job step
PYTHON_DIST_DIR: interface/python_binding/dist
VCPKG_INSTALL_OPTIONS: ${{ matrix.vcpkg_install_options && matrix.vcpkg_install_options || '' }}
VULKAN_SDK_VERSION: ${{ matrix.vulkan_sdk_version }}
# This is just to tell the Vulkan install script where to install.
# NOTE: Hardcoded $HOME expansion, due to 'env' context being unavailble in env:
VULKAN_INSTALL_DIR: /Users/runner/VulkanSDK/${{ matrix.vulkan_sdk_version }}
VULKAN_SDK: /Users/runner/VulkanSDK/${{ matrix.vulkan_sdk_version }}/macOS
steps:
- uses: actions/checkout@v4
with:
# Fetch all history to make sure tags are
# included (used for version creation)
fetch-depth: 0
- name: Add certificates to macOS keychain
env:
MACOS_CERTIFICATES_P12: ${{ secrets.MACOS_CERTIFICATES_P12 }}
MACOS_CERTIFICATES_PASSWORD: ${{ secrets.MACOS_CERTIFICATES_PASSWORD }}
ALTOOL_PASSWORD: ${{ secrets.ALTOOL_PASSWORD }}
ALTOOL_PW_LABEL: ${{ secrets.ALTOOL_PW_LABEL }}
run: ./scripts/before_build_macos.sh
- 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 }}
- name: before_install
run: |
echo -n "Running on the following GitHub Actions CI runner: " && uname -a
echo -n "CMake version on the runner is " && cmake --version
- name: Install Doxygen
if: matrix.options.doc == 'ON'
uses: ssciwr/doxygen-install@v1
- name: Install Graphviz
if: matrix.options.doc == 'ON'
uses: ts-graphviz/setup-graphviz@v2
- name: Install nuget and mono
# nuget & mono were removed from macos 15 runners because mono is
# unsupported and nuget needs mono. This will install both.
if: matrix.options.loadtests != 'OFF'
run: which nuget || brew install nuget -q
- name: Run install script
run: ./scripts/install_macos.sh
# Should a specific version of Python ever be wanted, use this.
# - name: Set up Python
# if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
# uses: actions/setup-python@v5
# with:
# python-version: '3.13'
# If the selected Python does not have virtualenv installed, use this.
# It is included currently in the runner's pre-installed Pythons.
#
# Note that the builds, via sdist and wheel, require a virtual env.
# regardless of whether the in-use Python is externally managed.
# Installing the explicit dependencies of pyktx only needs virtualenv
# and PY_USE_VENV: ON when Python is externally managed.
# - name: Install Python virtualenv
# if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
# run: pip install virtualenv
- name: Export environment variables for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
# actions/github-script is used primarily because it is the only
# way to access VCPKG_INSTALLATION_ROOT outside of the runner's shell.
# Maintaining cross-platform access is desirable so the code can be
# easily copied to a multi-platform workflow. NUGET_FEED_URL is set
# here to keep the vcpkg cache environment variables together.
uses: actions/github-script@v7
with:
# JSON in use here. #<comments> in the script will break it.
# Pre-installed vcpkg location is indicated by a non-standard env.
# var.
script: |
core.exportVariable('VCPKG_ROOT', process.env.VCPKG_INSTALLATION_ROOT || '');
core.exportVariable('VCPKG_EXE', process.env.VCPKG_INSTALLATION_ROOT + '/vcpkg' || '');
core.exportVariable('NUGET_FEED_URL', 'https://nuget.pkg.github.com/KhronosGroup/index.json' || '');
- name: Add NuGet sources for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
env:
USERNAME: KhronosGroup
shell: bash
run: |
nuget sources add \
-Source "${{ env.NUGET_FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
nuget setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${{ env.NUGET_FEED_URL }}"
- name: before_script
run: |
if [ "$FEATURE_TOOLS_CTS" = "ON" ]; then
git submodule update --init --recursive tests/cts
fi
if [ "$FEATURE_TESTS" = "ON" ]; then
git lfs pull --include=tests/srcimages,tests/testimage
fi
# Make sure embedded dates are correct.
./install-gitconfig.sh
scripts/smudge_date.sh
- name: script
env:
VCPKG_BINARY_SOURCES: clear;nuget,${{ env.NUGET_FEED_URL }},readwrite
run: |
set -e # Instead of trying to chain everything together with &&
# otherwise subsequent commands will swallow bad exit status.
if [ "$PLATFORM" = "macOS" ]; then
./scripts/build_macos.sh
else
./scripts/build_ios.sh
fi
set +e
# Re. packaging, note that the build script only creates packages for
# the Release configuration. If this is changed work will be needed
# here to prevent failures from uploading same-named artifacts from both
# Release and Debug configs. Only uploading artifacts from macos-latest
# prevents the same failure with artifacts from builds on older OSes.
# Notarization can only run if secrets were set (upstream repo)
- name: Notarize
env:
ALTOOL_PASSWORD: ${{ secrets.ALTOOL_PASSWORD }}
ALTOOL_PW_LABEL: ${{ secrets.ALTOOL_PW_LABEL }}
if: matrix.options.platform == 'macOS' && matrix.options.package == 'YES' && env.APPLE_ID
run: ./scripts/notarize.sh $BUILD_DIR/KTX-Software-*.pkg $APPLE_ID $DEVELOPMENT_TEAM $ALTOOL_PASSWORD
- name: Prepare KTX artifacts
if: matrix.options.package == 'YES'
id: ktx-version
run: |
KTX_VERSION=`cat $BUILD_DIR/ktx.version`
echo "PACKAGE_NAME_SUFFIX=${KTX_VERSION}-${{matrix.options.platform}}-${{matrix.arch}}" >> $GITHUB_ENV
# For these artifact uploads, need to take care that only one CLangCL
# "package" job for each architecture produces artifacts. A second
# job would attempt to upload a same-named artifact.
- name: Upload artifact Install Package
if: matrix.options.package == 'YES' && matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: KTX-Software-${{env.PACKAGE_NAME_SUFFIX}}
path: ${{env.BUILD_DIR}}/KTX-Software-*-*
compression-level: 0 # Installer already compressed.
- name: Upload artifact pyktx
if: matrix.options.py == 'ON' && matrix.options.package == 'YES' && matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: pyktx-${{env.PACKAGE_NAME_SUFFIX}}
path: ${{env.BUILD_DIR}}/${{env.PYTHON_DIST_DIR}}
- name: Upload to Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag' && github.event_name == 'push' && matrix.options.package == 'YES' && matrix.os == 'macos-latest'
with:
draft: true
prerelease: true
files: |
${{env.BUILD_DIR}}/KTX-Software-*-*
${{env.BUILD_DIR}}/${{env.PYTHON_DIST_DIR}}/pyktx-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+26
View File
@@ -0,0 +1,26 @@
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software Manual CI
on:
workflow_dispatch:
jobs:
android:
uses: ./.github/workflows/android.yml
linux:
uses: ./.github/workflows/linux.yml
macos:
uses: ./.github/workflows/macos.yml
mingw:
uses: ./.github/workflows/mingw.yml
web:
uses: ./.github/workflows/web.yml
windows:
uses: ./.github/workflows/windows.yml
all:
needs: [android, linux, macos, mingw, web, windows]
runs-on: ubuntu-latest
steps:
- run: exit 0
+85
View File
@@ -0,0 +1,85 @@
# 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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
- vcpkg.json
- vcpkg-configuration.json
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
mingw:
runs-on: windows-latest
defaults:
run:
shell: bash
env:
# To avoid bandwidth charges skip downloading source and golden images
# for texturetests etc., loadtests and legacy tool tests. They will be
# pulled later as necessary
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: scripts/on_failure.ps1
+138
View File
@@ -0,0 +1,138 @@
# 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
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
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 }}
+200
View File
@@ -0,0 +1,200 @@
# Copyright 2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software Web 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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/windows.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- RELEASE_NOTES.md
- REUSE.toml
- install-gitconfig*
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
#formatting:
# uses: ./.github/workflows/formatting.yml
web:
permissions:
contents: write
# Shortcircuit and don't burn CI time when formatting will reject
#needs: formatting
strategy:
matrix:
include:
- name: Debug
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: clang
vulkan_sdk_version: '1.3.290'
options: {
config: Debug,
doc: OFF, jni: OFF, loadtests: OpenGL, py: OFF, tools: OFF, tools_cts: OFF,
sse: OFF, opencl: OFF, wasm: ON
}
- name: Package
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: clang
vulkan_sdk_version: '1.3.290'
options: {
config: Release,
doc: OFF, jni: OFF, loadtests: OpenGL, py: OFF, tools: OFF, tools_cts: OFF,
package: YES, sse: OFF, opencl: OFF, wasm: ON
}
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
# To avoid bandwidth charges skip downloading source and golden images
# for texturetests etc., loadtests and legacy tool tests. They will be
# pulled later as necessary
GIT_LFS_SKIP_SMUDGE: 1
BUILD_DIR: build
REL_DESC_FILE: "build/rel_desc.md"
# Map test matrix elements to environmental variables, so that scripts launched from CI scripts may react to them.
# Some matrix variables have defaults if unspecified by the matrix
CMAKE_GEN: ${{ matrix.generator }}
ARCH: ${{ matrix.arch }}
CONFIGURATION: ${{ matrix.options.config }}
PLATFORM: ${{ matrix.options.platform }}
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 && matrix.options.tests || 'OFF' }}
FEATURE_TOOLS: ${{ matrix.options.tools }}
FEATURE_TOOLS_CTS: ${{ matrix.options.tools_cts }}
PACKAGE: ${{ matrix.options.package && matrix.options.package || 'NO' }}
SUPPORT_OPENCL: ${{ matrix.options.opencl }}
SUPPORT_SSE: ${{ matrix.options.sse }}
WASM_BUILD: ${{ matrix.options.wasm && matrix.options.wasm || 'OFF' }}
WERROR: ${{ matrix.options.werror && matrix.options.werror || 'ON' }}
# CC Handled by job step
# CXX Handled by job step
PYTHON_DIST_DIR: interface/python_binding/dist
VULKAN_SDK_VERSION: ${{ matrix.vulkan_sdk_version }}
steps:
- uses: actions/checkout@v4
with:
# Fetch all history to make sure tags are
# included (used for version creation)
fetch-depth: 0
- name: Set compiler
if: matrix.compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
elif [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "Unknown compiler toolchain set"
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 }}
- name: before_install
run: |
echo -n "Running on the following GitHub Actions CI runner: " && uname -a
echo -n "CMake version on the runner is " && cmake --version
# Set uid/gid. Without it all commands are run by the default
# docker user root (0), and, in the Linux version of the Docker
# engine /src will be owned by the user running this workflow
# (usually 1001). This results in `git` commands within the build
# script failing with
#
# "fatal: detected dubious ownership in repository at '/src'."
#
# This is due to the fix for CVE-2022-24765. See
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
# The build script uses `git describe` to create version numbers.
#
# Also with the Linux version of the Docker engine, all products of
# the build in $BUILD_DIR are owned by root unless uid/gid is set.
#
docker run -dit --name emscripten --user "$(id -u):$(id -g)" -v $(pwd):/src emscripten/emsdk bash
- name: before_script
run: |
if [ "$FEATURE_TOOLS_CTS" = "ON" ]; then
git submodule update --init --recursive tests/cts
fi
if [ "$FEATURE_TESTS" = "ON" ]; then
git lfs pull --include=tests/srcimages,tests/testimage
fi
# Make sure embedded dates are correct.
./install-gitconfig.sh
scripts/smudge_date.sh
- name: script
run: |
./scripts/build_wasm_docker.sh
- name: Prepare KTX artifacts
if: matrix.options.package == 'YES'
id: ktx-version
run: |
KTX_VERSION=`cat $BUILD_DIR/ktx.version`
echo "PACKAGE_NAME_SUFFIX=${KTX_VERSION}-Web" >> $GITHUB_ENV
# For these artifact uploads, need to take care that only one CLangCL
# "package" job for each architecture produces artifacts. A second
# job would attempt to upload a same-named artifact.
- name: Upload artifact Install Package
if: matrix.options.package == 'YES'
uses: actions/upload-artifact@v4
with:
name: KTX-Software-${{env.PACKAGE_NAME_SUFFIX}}
path: ${{env.BUILD_DIR}}/KTX-Software-*-*
- name: Upload to Release
uses: softprops/action-gh-release@v2
if: matrix.options.package == 'YES' && github.event_name == 'push' && github.ref_type == 'tag'
with:
draft: true
prerelease: true
files: |
${{env.BUILD_DIR}}/KTX-Software-*-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+389
View File
@@ -0,0 +1,389 @@
# 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
- .github/workflows/android.yml
- .github/workflows/check-mkvk.yml
- .github/workflows/docs.yml
- .github/workflows/mingw.yml
- .github/workflows/publish-pyktx.yml
- .travis.yml
- README.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- LICENSE.md
- LICENSES
- REUSE.toml
# Allow manual trigger
workflow_dispatch:
workflow_call:
jobs:
#formatting:
# uses: ./.github/workflows/formatting.yml
windows:
permissions:
packages: write
contents: write
# Shortcircuit and don't burn CI time when formatting will reject
#needs: formatting
strategy:
matrix:
os: [ windows-latest ]
generator: [ 'Visual Studio 17 2022' ]
toolset: [v143, CLangCL]
arch: [ x64 ]
java-version: [ '17' ]
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-2022
generator: 'Visual Studio 17 2022'
toolset: v143
arch: x64
java-version: '17'
options: {
config: 'Debug,Release',
doc: OFF, 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
#vcpkg_install_options: --debug
options: {
config: 'Debug,Release',
# Can't run arm64 tests on x86 runner. Can't cross-compile Vulkan apps.
# Vulkan is added to test the build script correctly forces OpenGL only.
doc: ON, jni: OFF, loadtests: OpenGL+Vulkan, py: OFF, tests: OFF, tools: ON, tools_cts: OFF,
package: NO
}
- os: windows-11-arm
generator: 'Visual Studio 17 2022'
toolset: CLangCL
arch: arm64
# Oldest version available on arm runner.
java-version: '21'
#vcpkg_install_options: --debug
options: {
config: 'Debug,Release',
doc: ON, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tests: ON, tools: ON, tools_cts: ON,
package: YES
}
runs-on: ${{ matrix.os }}
env:
# To avoid bandwidth charges skip downloading source and golden images
# for texturetests etc., loadtests and legacy tool tests. They will be
# pulled later as necessary
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 }}
PY_USE_VENV: ${{ matrix.options.py.use_venv && matrix.options.py_use_venv || 'OFF' }}
WERROR: ON
VCPKG_INSTALL_OPTIONS: ${{ matrix.vcpkg_install_options && matrix.vcpkg_install_options || '' }}
# 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
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_DIST_DIR: interface/python_binding/dist
VULKAN_SDK_VERSION: 1.4.313.2
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
# NSIS was removed from windows-2025 (windows-latest as of this writing).
# Earlier runner images only have NSIS 3.08 so install latest everywhere.
if: matrix.check_mkvk != 'ONLY'
uses: repolevedavaj/install-nsis@v1.0.3
with:
nsis-version: '3.11'
- name: Install NSIS with large string support
# This replaces some items in the full NSIS installation.
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.11-strlen_8192.zip https://sourceforge.net/projects/nsis/files/NSIS%203/3.11/nsis-3.11-strlen_8192.zip
if [[ $? -eq 0 ]] ; then
success=1
7z x -aoa -o"/c/Program Files (x86)/NSIS" nsis-3.11-strlen_8192.zip
rm nsis-3.11-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 }}
- name: Install Git LFS
if: matrix.os == 'windows-11-arm'
run: git lfs install
- name: Install Doxygen
uses: ssciwr/doxygen-install@v1
- name: Install Graphviz
uses: ts-graphviz/setup-graphviz@v2
- 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: Export environment variables for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
# actions/github-script is used primarily because it is the only
# way to access VCPKG_INSTALLATION_ROOT outside of the runner's shell.
# Maintaining cross-platform access is desirable so the code can be
# easily copied to a multi-platform workflow. NUGET_FEED_URL is set
# here to keep the vcpkg cache environment variables together.
uses: actions/github-script@v7
with:
# JSON in use here. #<comments> in the script will break it.
# Pre-installed vcpkg location is indicated by a non-standard env.
# var.
script: |
core.exportVariable('VCPKG_ROOT', process.env.VCPKG_INSTALLATION_ROOT || '');
core.exportVariable('VCPKG_EXE', process.env.VCPKG_INSTALLATION_ROOT + '/vcpkg' || '');
core.exportVariable('NUGET_FEED_URL', 'https://nuget.pkg.github.com/KhronosGroup/index.json' || '');
- name: Add NuGet sources for vcpkg binary caching
if: matrix.options.loadtests != 'OFF'
env:
USERNAME: KhronosGroup
shell: pwsh
# `vcpkg fetch nuget` fetches nuget and outputs the location of
# the fetched command.
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.NUGET_FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GITHUB_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.GITHUB_TOKEN }}" `
-Source "${{ env.NUGET_FEED_URL }}"
- name: Install Dependencies
if: matrix.check_mkvk != 'ONLY'
# This script only installs what's needed by ON FEATUREs.
run: scripts/install_win.ps1
- name: Set up JDK.
if: matrix.options.jni == 'ON' && matrix.check_mkvk != 'ONLY'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
# Pre-installed Python in Windows Server 2022 is 3.9. However
# CMake finds the latest on the runner (3.13.5 now). Should a
# a specific version of Python ever be wanted, use this.
# A bug in 3.13.4 for Windows
# (https://github.com/python/cpython/issues/135151) means it looks
# like a free-threaded (whatever that means) version to CPython leading
# to an error that the "limited API" (whatever that is) is not supported
# by free-threaded Python. This is fixed in 3.13.5. Not all the runners
# have been updated (see https://github.com/actions/runner-images/issues/12377).
# Install a version that works.
- name: Set up Python 3.12
if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
uses: actions/setup-python@v5
with:
python-version: '3.12'
# virtualenv is no longer included as of 20240929.1 runner so
# install it ourselves. See
# https://github.com/actions/runner-images/issues/10749.
#
# Note that the builds, via sdist and wheel, require a virtual env.
# regardless of whether the in-use Python is externally managed.
# Installing the explicit dependencies of pyktx only needs virtualenv
# and PY_USE_VENV: ON when Python is externally managed. The packages
# on the Windows runners are not externally managed.
- name: Install Python virtualenv
if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY'
run: pip install virtualenv
- name: Init CTS submodule
if: matrix.options.tools_cts =='ON'
run:
git submodule update --init --recursive tests/cts
- name: Pull LFS files
if: matrix.options.tests == 'ON'
run: git lfs pull --include=tests/srcimages,tests/testimages
- name: Smudge embedded dates
if: matrix.options.doc == 'ON'
run: |
./install-gitconfig.ps1
scripts/smudge_date.ps1
- name: Build Windows
if: matrix.check_mkvk != 'ONLY'
env:
VCPKG_BINARY_SOURCES: clear;nuget,${{ env.NUGET_FEED_URL }},readwrite
# 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
scripts/build_win.ps1
- name: Test Generation of VkFormat-related files
if: matrix.check_mkvk == 'ONLY'
run: 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.options.tests == 'ON'
run: ctest --output-on-failure --test-dir $env:BUILD_DIR -C Release
# - name: Upload test log
# if: ${{ failure() }}
# run: 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
# For these artifact uploads, need to take care that only one CLangCL
# "package" job for each architecture produces artifacts. A second
# job would attempt to upload a same-named artifact.
- name: Upload artifact Install Package
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*
compression-level: 0 # Installer already compressed.
- name: Upload artifact pyktx
if: matrix.options.package == 'YES' && matrix.options.py == 'ON' && matrix.toolset == 'CLangCL'
uses: actions/upload-artifact@v4
with:
name: pyktx-${{env.KTX_VERSION}}-Windows-${{matrix.arch}}
path: ${{env.BUILD_DIR}}/${{env.PYTHON_DIST_DIR}}
- name: Upload to Release
uses: softprops/action-gh-release@v2
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}}/${{env.PYTHON_DIST_DIR}}/pyktx-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}