forked from KhronosGroup/Vulkan-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (143 loc) · 5.64 KB
/
build.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build Project
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build ${{ matrix.platform.runtime }} in ${{ matrix.build_type }}"
strategy:
matrix:
platform: [{ os: windows, runtime: windows-latest }, { os: ubuntu, runtime: ubuntu-latest }, { os: macos, runtime: macos-12 }]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
runs-on: "${{ matrix.platform.runtime }}"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- if: ${{ matrix.platform.os == 'ubuntu' }}
name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- if: ${{ matrix.platform.os == 'windows' }}
name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- if: ${{ matrix.platform.os == 'windows' }}
name: sccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- if: ${{ matrix.platform.os != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- if: ${{ matrix.platform.os == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform.os }}" -G"Ninja" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform.os != 'windows' }}
name: Configure and build
run: |
cmake -B"build/${{ matrix.platform.os }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }}
build_apple_silicon:
strategy:
matrix:
platform: [{ os: macos, runtime: macos-14 }]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
# Only run on main due to provisioning time for Apple Silicon runners
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: "${{ matrix.platform.runtime }}"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- if: ${{ matrix.platform.os == 'ubuntu' }}
name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- if: ${{ matrix.platform.os == 'windows' }}
name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- if: ${{ matrix.platform.os == 'windows' }}
name: sccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- if: ${{ matrix.platform.os != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- if: ${{ matrix.platform.os == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform.os }}" -G"Ninja" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform.os != 'windows' }}
name: Configure and build
run: |
cmake -B"build/${{ matrix.platform.os }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
cmake --build "build/${{ matrix.platform.os }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }}
build_d2d:
name: "Build Ubuntu with Direct To Display"
env:
PARALLEL: -j 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: Configure
run: cmake -B"build/ubuntu-latest-d2d" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DVKB_WSI_SELECTION=D2D
- name: "Build Ubuntu in Release with VKB_WSI_SELECTION=D2D"
run: cmake --build "build/ubuntu-latest-d2d" --target vulkan_samples --config Release ${{ env.PARALLEL }}
build_android:
name: "Build Android in ${{ matrix.build_type }}"
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
cache: gradle
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: "Run generate script"
run: ./scripts/generate.py android
- name: "Build Android using gradlew."
working-directory: build/android_gradle
run: NDK_CCACHE=1 NDK_CCACHE_BIN=ccache ./gradlew app:assemble${{ matrix.build_type }} --info