forked from BinomialLLC/KTX-Software-Binomial-Fork
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (122 loc) · 5.14 KB
/
check-libktx-only.yml
File metadata and controls
137 lines (122 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: Check Config and Build of libktx as top-level project and sub-project
# The purpose of this is to smoke test building just libktx using its
# CMakeLists.txt as both a top-level project and sub-project that is
# not related to the KTX-Software project. Testing of various build
# options and running of tests on the library is left to the various
# KTX-Software platform workflows.
# 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/check-reuse.yml
- .github/workflows/docs.yml
- .github/workflows/formatting.yml
- .github/workflows/linux.yml
- .github/workflows/macos.yml
- .github/workflows/manual.yml
- .github/workflows/mingw.yml
- .github/workflows/publish-pyktx.yml
- .github/workflows/web.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:
check-libktx-only:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
config: [ Release ]
static: [ OFF, ON ]
generator: [ 'Ninja Multi-Config' ]
exclude:
- os: windows-latest
generator: 'Ninja Multi-Config'
include:
# The NMC generator defaults to using GCC and GCC names dlls with
# a "lib" prefix and the import files with both the prefix and a
# ".dll.a" extension. I have neither the time nor energy to find out
# how to change the behaviour. Use VS.
- os: windows-latest
generator: 'Visual Studio 17 2022'
config: Release
static: OFF
- os: windows-latest
generator: 'Visual Studio 17 2022'
config: Release
static: ON
runs-on: ${{ matrix.os }}
env:
GIT_LFS_SKIP_SMUDGE: 1
BUILD_DIR_TL: "build/tl"
BUILD_DIR_UKP: "build/ukp"
SOURCE_DIR_LIB: "lib"
SOURCE_DIR_UKP: "tests/use-ktx"
# In theory it should not matter, but this image is chosen to exercise
# some of the functions in one of the library dependencies.
KTX2_TEST_FILE: "tests/resources/ktx2/kodim17_blze.ktx2"
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: Fetch test image from LFS and check it out
run: git lfs fetch ${{ env.KTX2_TEST_FILE }} && git lfs checkout ${{ env.KTX2_TEST_FILE }}
- name: Configure as top-level project
run: cmake -S ${{ env.SOURCE_DIR_LIB }} -B ${{ env.BUILD_DIR_TL }} -G "${{ matrix.generator }}" -DLIBKTX_WERROR=${{ env.WERROR }} -DLIBKTX_VERSION_READ_ONLY=ON
- name: Build libktx with top-level project
run: cmake --build ${{ env.BUILD_DIR_TL }} --config=Release
- name: Configure as sub-project, static library is ${{ matrix.static }}
run: cmake -S ${{ env.SOURCE_DIR_UKP }} -B ${{ env.BUILD_DIR_UKP }} -G "${{ matrix.generator }}" -DLIBKTX_WERROR=${{ env.WERROR }} -DUSE_STATIC_LIBRARY=${{ matrix.static }}
- name: Build use-ktx and libktx projects, static library is ${{ matrix.static }}
run: cmake --build ${{ env.BUILD_DIR_UKP }} --config=Release
- name: Prepare version number and architecture for artifact
id: libktx-version
shell: bash
# Arch set up is to match arch to names used in releases and platforms.
# N.B. If `>> ${{ github.env }} is used here variables are not seen in
# following step on Windows runners. Linux and macOS have no problem.
run: |
echo KTX_VERSION=$(grep -A 1 -m 1 "Code version" lib/src/version.h | tail -n 1) >> $GITHUB_ENV
arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')
if [ "$arch" = "x64" ]; then arch=x86_64; fi
echo ARCH=$arch >> $GITHUB_ENV
- name: Check content of output directory from top-level build
run: scripts/check_lib_build_output.sh ${{ env.BUILD_DIR_TL }}/${{ matrix.config }}
- name: Test run use-ktx program
run: ${{ env.BUILD_DIR_UKP }}/Release/use-ktx ${{ env.KTX2_TEST_FILE }}
- name: Upload artifact libktx
if: matrix.static == 'OFF'
uses: actions/upload-artifact@v4
with:
name: libktx-${{ env.KTX_VERSION }}-${{ runner.os }}-${{ env.ARCH }}
path: ${{env.BUILD_DIR_TL}}/Release/*ktx*