Skip to content

Commit

Permalink
[repo] CodeQL workflow tweaks (open-telemetry#1581)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Feb 14, 2024
1 parent 2cc336f commit da14596
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: "CodeQL"

on:
schedule:
- cron: '0 0 * * *' # once in a day at 00:00
- cron: '0 0 * * *' # once in a day at 00:00
workflow_dispatch:

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

steps:
- name: configure Pagefile
Expand All @@ -35,31 +31,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

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

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
- name: dotnet pack opentelemetry-dotnet-contrib.proj
run: dotnet pack opentelemetry-dotnet-contrib.proj --configuration Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
12 changes: 10 additions & 2 deletions opentelemetry-dotnet-contrib.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

<ItemGroup>
<SolutionProjects Include="**\*.csproj" />

<TestProjects Include="test\**\*.csproj" />
<PackProjects Include="src\**\*.csproj" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore;Build" ContinueOnError="ErrorAndStop" />
<MSBuild Projects="@(SolutionProjects)" Targets="Build" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
</Target>

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

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>

0 comments on commit da14596

Please sign in to comment.