-
Notifications
You must be signed in to change notification settings - Fork 292
85 lines (83 loc) · 2.87 KB
/
build.yaml
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
name: Build
on:
workflow_call:
inputs:
codeql:
type: boolean
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
preset: windows-ci
- os: ubuntu-20.04
preset: linux-ci
- os: macos-13
preset: macos-ci
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: 'npm'
cache-dependency-path: vcpkg-artifacts/package-lock.json
- uses: lukka/[email protected]
with:
cmakeVersion: 3.22.1 # ubuntu 22.04
ninjaVersion: 1.11.1
- name: Enable Problem Matchers
run: echo "::add-matcher::.github/workflows/matchers.json"
- name: '[CI Only] Initialize CodeQL'
if: inputs.codeql
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript, c-cpp
- name: Configure and Build
if: matrix.preset != 'windows-ci'
run: |
cmake --preset ${{ matrix.preset }}
cmake --build --preset ${{ matrix.preset }} -- -k0
- name: Configure and Build (Windows)
if: matrix.preset == 'windows-ci'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
IF %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
cl /Bv
set CXX=cl
set CC=cl
cmake --preset ${{ matrix.preset }}
IF %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
cmake --build --preset ${{ matrix.preset }} -- -k0
- name: '[CI Only] Perform CodeQL Analysis'
if: inputs.codeql
uses: github/codeql-action/analyze@v3
- name: Run vcpkg unit tests
run: ctest --preset ${{ matrix.preset }} --output-on-failure 2>&1
- name: Run vcpkg-artifacts unit tests
run: |
cd out/build/${{ matrix.preset }}/vcpkg-artifacts
node node_modules/mocha/bin/mocha --config mocha-config.yaml
- name: Get microsoft/vcpkg pinned sha into VCPKG_SHA
id: vcpkg_sha
shell: pwsh
run: |
"VCPKG_SHA="+(Get-Content vcpkg-init/vcpkg-scripts-sha.txt -Raw).Trim() >> $env:GITHUB_OUTPUT
- name: Checkout microsoft/vcpkg for end-to-end tests
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{ github.workspace }}/vcpkg-root
repository: microsoft/vcpkg
ref: ${{ steps.vcpkg_sha.outputs.VCPKG_SHA }}
- name: Run vcpkg end-to-end tests
shell: pwsh
run: |
cd out/build/${{ matrix.preset }}
${{ github.workspace }}/azure-pipelines/end-to-end-tests.ps1 -RunArtifactsTests
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg-root