-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (56 loc) · 1.68 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
name: Build
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
build:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: Windows
os: windows-latest
preset: windows-x64-release
- name: Linux
os: ubuntu-latest
preset: linux-release
- name: macOS
os: macos-14
preset: macos-arm64-release
runs-on: ${{ matrix.os }}
steps:
- name: Find MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Choose the latest XCode (macOS)
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Get cmake and ninja
uses: lukka/get-cmake@latest
- name: Fetch repo
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: external/vcpkg/vcpkg
vcpkgJsonGlob: cmake/vcpkg.json
prependedCacheKey: "build/${{ matrix.preset }}"
- name: Build
uses: lukka/run-cmake@v10
with:
configurePreset: "${{ matrix.preset }}"
buildPreset: "${{ matrix.preset }}"
testPreset: "${{ matrix.preset }}"
- name: Block cache on failure
if: ${{ failure() || cancelled() }}
shell: bash
run: echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV