-
Notifications
You must be signed in to change notification settings - Fork 62
105 lines (87 loc) · 3.07 KB
/
codeql.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
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "feature/*"]
schedule:
- cron: '20 3 * * 1'
permissions:
contents: read
# only allow one instance of this workflow to be running per PR or branch, cancels any that are already running
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-modified-files:
name: Check if source files were modified, skip remaining jobs if not
uses: ./.github/workflows/check_modified_files.yml
secrets: inherit
permissions:
contents: read
pull-requests: read
analyze-dotnet:
name: Analyze .NET
needs: check-modified-files
if: needs.check-modified-files.outputs.non-workflow-files-changed == 'true'
runs-on: windows-latest
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
env:
fullagent_solution_path: ${{ github.workspace }}\FullAgent.sln
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Initialize CodeQL
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
languages: csharp
- name: Build .NET Agent Solution
run: |
dotnet build ${{ env.fullagent_solution_path }}
shell: powershell
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
category: "/language:csharp"
analyze-cpp:
name: Analyze C++
needs: check-modified-files
if: needs.check-modified-files.outputs.non-workflow-files-changed == 'true'
runs-on: windows-latest
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
env:
profiler_solution_path: ${{ github.workspace }}\src\Agent\NewRelic\Profiler\NewRelic.Profiler.sln
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Initialize CodeQL
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
languages: c-cpp
- name: Add msbuild to PATH for Profiler build
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
- name: Build Profiler
run: |
Write-Host "List NuGet Sources"
dotnet nuget list source # For unknown reasons, this step is necessary to avoid subsequent problems with NuGet package restore
Write-Host "MSBuild.exe -restore -m -p:Platform=x64 ${{ env.profiler_solution_path }}"
MSBuild.exe -restore -m -p:Platform=x64 ${{ env.profiler_solution_path }}
shell: powershell
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
category: "/language:c-cpp"