-
Notifications
You must be signed in to change notification settings - Fork 15
87 lines (66 loc) · 2.51 KB
/
pr.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
name: PR Build
env:
# Set up vcpkg to read from the GitHub cache (https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache)
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
on:
pull_request:
branches: [ "main" ]
jobs:
build-windows:
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v4
- name: Set up required environment variables for vcpkg cache
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 || '');
- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql
- name: Install Winget
uses: ./.github/workflows/install-winget
- name: Setup
shell: pwsh
run: .\scripts\Setup.ps1
- name: Check formatting
shell: pwsh
run: python .\scripts\check-format.py
- name: Build and Test (no test overrides)
shell: pwsh
run: |
.\scripts\Build.ps1
.\scripts\Test.ps1 -OutputOnFailure
- name: Build and Test (with test overrides)
shell: pwsh
run: |
.\scripts\Build.ps1 -EnableTestOverrides
.\scripts\Test.ps1 -OutputOnFailure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up required environment variables for vcpkg cache
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 || '');
- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql
- name: Setup
run: source ./scripts/setup.sh
- name: Check formatting
run: python ./scripts/check-format.py
- name: Build and Test (no test overrides)
run: |
./scripts/build.sh
./scripts/test.sh --output-on-failure
- name: Build and Test (with test overrides)
run: |
./scripts/build.sh --enable-test-overrides
./scripts/test.sh --output-on-failure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3