-
Notifications
You must be signed in to change notification settings - Fork 100
68 lines (55 loc) · 2.29 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
name: Build
env:
# Compile in parallel where possible.
CL: /MP
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
# Triggers the workflow on push or pull request events for all branches.
on: [ push, pull_request ]
permissions:
contents: read
jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-2022 ]
arch: [ x86 ]
conf: [ Debug, Release ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- name: Configure ${{ matrix.arch }}
shell: cmd
run: cmake -B ${{ env.build }} -H. -A Win32 # ${{ matrix.arch }}
- name: Build ${{ matrix.conf }}
shell: cmd
run: cmake --build build --config ${{ matrix.conf }}
- name: Upload artifacts for ${{ matrix.conf }}-${{ matrix.arch }}
uses: actions/upload-artifact@v3
with:
name: gta_reversed-${{ matrix.conf }}
path: bin/${{ matrix.conf }}
- name: Initialize MSVC Code Analysis
uses: microsoft/[email protected]
# Provide a unique ID to access the sarif output path
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
# Ruleset file that will determine what checks will be run
ruleset: NativeRecommendedRules.ruleset
buildConfiguration: ${{ matrix.conf }}
# Exclude external libraries from analysis
ignoredPaths: ${{ github.workspace }}/libs
# Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}