-
Notifications
You must be signed in to change notification settings - Fork 69
122 lines (102 loc) · 3.72 KB
/
Copy pathcodeql.yml
File metadata and controls
122 lines (102 loc) · 3.72 KB
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
112
113
114
115
116
117
118
119
120
121
122
name: "CodeQL"
on:
pull_request:
branches:
- main
- "feature/**"
paths:
- "src/**" # CodeQL only needs to scan the src directory
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.source-files-changed == 'true'
runs-on: windows-latest
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
env:
fullagent_solution_path: ${{ github.workspace }}\FullAgent.sln
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
filter: blob:none
- name: Cache NuGet packages
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Install latest .NET 10 SDK
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: '10.0.x'
dotnet-quality: 'ga'
- name: Initialize CodeQL
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: csharp
config-file: ./.github/codeql/codeql-config.yml
- name: Build .NET Agent Solution
run: |
dotnet build ${{ env.fullagent_solution_path }}
shell: powershell
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
category: "/language:csharp"
analyze-cpp:
name: Analyze C++
needs: check-modified-files
if: needs.check-modified-files.outputs.source-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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
filter: blob:none
- name: Initialize CodeQL
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: c-cpp
config-file: ./.github/codeql/codeql-config.yml
- 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@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
category: "/language:c-cpp"