Skip to content

Commit da14596

Browse files
authored
[repo] CodeQL workflow tweaks (open-telemetry#1581)
1 parent 2cc336f commit da14596

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

.github/workflows/codeql-analysis.yml

+5-24
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: "CodeQL"
77

88
on:
99
schedule:
10-
- cron: '0 0 * * *' # once in a day at 00:00
10+
- cron: '0 0 * * *' # once in a day at 00:00
1111
workflow_dispatch:
1212

1313
jobs:
@@ -18,11 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
# Override automatic language detection by changing the below list
22-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
2321
language: ['csharp']
24-
# Learn more...
25-
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
2622

2723
steps:
2824
- name: configure Pagefile
@@ -35,31 +31,16 @@ jobs:
3531
- name: Checkout repository
3632
uses: actions/checkout@v4
3733

38-
# Initializes the CodeQL tools for scanning.
3934
- name: Initialize CodeQL
4035
uses: github/codeql-action/init@v3
4136
with:
4237
languages: ${{ matrix.language }}
43-
# If you wish to specify custom queries, you can do so here or in a config file.
44-
# By default, queries listed here will override any specified in a config file.
45-
# Prefix the list here with "+" to use these queries and those in the config file.
46-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
4738

48-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
49-
# If this step fails, then you should remove it and run the build manually (see below)
50-
- name: Autobuild
51-
uses: github/codeql-action/autobuild@v3
39+
- name: Setup dotnet
40+
uses: actions/setup-dotnet@v4
5241

53-
# ℹ️ Command-line programs to run using the OS shell.
54-
# 📚 https://git.io/JvXDl
55-
56-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
57-
# and modify them (or add more) to build your code if your project
58-
# uses a compiled language
59-
60-
#- run: |
61-
# make bootstrap
62-
# make release
42+
- name: dotnet pack opentelemetry-dotnet-contrib.proj
43+
run: dotnet pack opentelemetry-dotnet-contrib.proj --configuration Release
6344

6445
- name: Perform CodeQL Analysis
6546
uses: github/codeql-action/analyze@v3

opentelemetry-dotnet-contrib.proj

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22

33
<ItemGroup>
44
<SolutionProjects Include="**\*.csproj" />
5-
5+
<TestProjects Include="test\**\*.csproj" />
66
<PackProjects Include="src\**\*.csproj" />
77
</ItemGroup>
88

99
<Target Name="Build">
10-
<MSBuild Projects="@(SolutionProjects)" Targets="Restore;Build" ContinueOnError="ErrorAndStop" />
10+
<MSBuild Projects="@(SolutionProjects)" Targets="Build" ContinueOnError="ErrorAndStop" />
11+
</Target>
12+
13+
<Target Name="Restore">
14+
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
1115
</Target>
1216

1317
<Target Name="Pack">
1418
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
1519
</Target>
1620

21+
<Target Name="VSTest">
22+
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
23+
</Target>
24+
1725
</Project>

0 commit comments

Comments
 (0)