-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (97 loc) · 3.64 KB
/
quality.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
name: Quality
on:
pull_request:
branches:
- main
- development
push:
branches:
- main
- development
workflow_dispatch:
inputs:
debug:
description: 'Set to true to enable debug mode'
required: false
default: 'false'
jobs:
quality:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-latest
triplet: x64-linux
- os: macos-latest
triplet: x64-osx
env:
# Indicates the location of the vcpkg as a Git submodule of the project repository.
VCPKG_ROOT: ${{ github.workspace }}/deps/vcpkg
# Tells vcpkg where binary packages are stored.
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/deps/vcpkg/bincache
# Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
steps:
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v4
with:
submodules: true
# Create the directory to store the vcpkg's binary cache.
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
# Set up the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest
- name: List $RUNNER_WORKSPACE before vcpkg is setup
run: find $RUNNER_WORKSPACE
if: ${{ inputs.debug == 'true' }}
shell: bash
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ env.VCPKG_ROOT }}'
vcpkgJsonGlob: '**/vcpkg.json'
- name: List $RUNNER_WORKSPACE before build
run: find $RUNNER_WORKSPACE
if: ${{ inputs.debug == 'true' }}
shell: bash
- name: Prints output of run-vcpkg's action.
if: ${{ inputs.debug == 'true' }}
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
- name: Run CMake+vcpkg+Ninja
uses: lukka/run-cmake@v10
id: runcmake
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
configurePreset: 'vcpkg-fmt-template-ninja-multiconfiguration-vcpkg'
buildPreset: 'vcpkg-fmt-template-ninja-multiconfiguration-vcpkg'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
if: ${{ inputs.debug == 'true' }}
shell: bash
# Upload vcpkg's logs as artifacts.
- name: Upload vcpkg build log files
if: failure()
uses: actions/upload-artifact@v4
with:
name: vcpkg-log-files-${{ matrix.os }}
path: deps/vcpkg/buildtrees/**/*.log
# Upload builds logs as artifacts.
- name: Upload builds log files
if: failure()
uses: actions/upload-artifact@v4
with:
name: builds-log-files-${{ matrix.os }}
path: builds/**/*.log