-
Notifications
You must be signed in to change notification settings - Fork 16
117 lines (105 loc) · 4.37 KB
/
main.yml
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
name: Build
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (MSVC), os: windows-2019, shell: sh, msvc: true, artifact: 'SDL3_gpu_shadercross-VC-x64' }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, artifact: 'SDL3_gpu_shadercross-mingw64' }
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh, artifact: 'SDL3_gpu_shadercross-linux-x64' }
- { name: Steam Linux Runtime (Sniper), os: ubuntu-latest, shell: sh, artifact: 'SDL3_gpu_shadercross-slrsniper', container: 'registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta' }
- { name: macOS, os: macos-latest, shell: sh, artifact: 'SDL3_gpu_shadercross-macos-x64' }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Ninja
uses: ./.github/actions/setup-ninja
if: ${{ !contains(matrix.platform.shell, 'msys2') && !contains(matrix.platform.container, 'steamrt') }}
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.platform.msvc }}
with:
arch: x64
- name: Set up MSYS2
if: ${{ matrix.platform.shell == 'msys2 {0}' }}
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-ninja
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
cmake-generator: Ninja
version: 3-head
sdl-test: true
shell: ${{ matrix.platform.shell }}
discriminator: ${{ matrix.platform.artifact }}
- name: Install Linux requirements
if: ${{ contains(matrix.platform.os, 'ubuntu') }}
run: |
# patchelf is needed to fix the runpath of libSDL3.so.0
wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-x86_64.tar.gz
tar xf patchelf-0.18.0-x86_64.tar.gz ./bin/patchelf
echo "$PWD/bin" >>$GITHUB_PATH
# libxrandr-dev is needed by vulkan-loader
sudo apt-get update -y
sudo apt-get install -y patchelf libxrandr-dev
- name: Install macOS requirements
if: ${{ runner.os == 'macOS' }}
run: |
# bison is needed by vkd3d
brew install bison
echo "/opt/homebrew/opt/bison/bin" >>$GITHUB_PATH
- name: Configure (CMake)
run: |
cmake -S . -B build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DSDLGPUSHADERCROSS_SHARED=ON \
-DSDLGPUSHADERCROSS_STATIC=ON \
-DSDLGPUSHADERCROSS_VENDORED=ON \
-DSDLGPUSHADERCROSS_CLI=ON \
-DSDLGPUSHADERCROSS_WERROR=ON \
-DSDLGPUSHADERCROSS_INSTALL=ON \
-DSDLGPUSHADERCROSS_INSTALL_DEPS=ON \
-DSDLGPUSHADERCROSS_INSTALL_CPACK=ON \
-DCMAKE_INSTALL_PREFIX="${PWD}/prefix"
- name: Build (CMake)
id: build
run: |
cmake --build build --config Release --parallel --verbose
- name: Install (CMake)
id: install
if: ${{ always() && steps.build.outcome == 'success' }}
run: |
cmake --install build/ --config Release
- name: Package (CPack)
id: package
if: ${{ always() && steps.build.outcome == 'success' }}
run: |
cmake --build build/ --target package
- name: Verify CMake configuration files
if: ${{ always() && steps.install.outcome == 'success' }}
run: |
cmake -S cmake/test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PWD}/prefix" \
-GNinja
cmake --build cmake_config_build --verbose
- uses: actions/upload-artifact@v4
if: ${{ always() && steps.package.outcome == 'success' }}
with:
if-no-files-found: error
name: ${{ matrix.platform.artifact }}
path: build/dist/SDL*