Skip to content

Commit b3d6b9b

Browse files
Merge pull request microsoft#178 from microsoft/AddCodeQL
Adding CodeQL yml
2 parents 085f0c7 + b52faa6 commit b3d6b9b

File tree

2 files changed

+86
-3
lines changed

2 files changed

+86
-3
lines changed

.github/workflows/codeql.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
schedule:
20+
- cron: '45 22 * * 3'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
actions: read
34+
contents: read
35+
security-events: write
36+
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
language: [ 'csharp' ]
41+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
42+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
43+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
44+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
# Initializes the CodeQL tools for scanning.
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@v3
53+
with:
54+
languages: ${{ matrix.language }}
55+
# If you wish to specify custom queries, you can do so here or in a config file.
56+
# By default, queries listed here will override any specified in a config file.
57+
# Prefix the list here with "+" to use these queries and those in the config file.
58+
59+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
60+
# queries: security-extended,security-and-quality
61+
62+
63+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64+
# If this step fails, then you should remove it and run the build manually (see below)
65+
#- name: Autobuild
66+
# uses: github/codeql-action/autobuild@v3
67+
68+
# Custom build step for C#
69+
- name: Build C# Solution
70+
run: |
71+
dotnet build Sources/Trill.sln
72+
73+
# ℹ️ Command-line programs to run using the OS shell.
74+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
75+
76+
# If the Autobuild fails above, remove it and uncomment the following three lines.
77+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
78+
79+
# - run: |
80+
# echo "Run, Build Application using script"
81+
# ./location_of_script_within_repo/buildscript.sh
82+
83+
- name: Perform CodeQL Analysis
84+
uses: github/codeql-action/analyze@v3
85+
with:
86+
category: "/language:${{matrix.language}}"

Sources/Test/SimpleTesting/SimpleTesting.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,4 @@
160160
<DependentUpon>ShuffleStreamableTests.tt</DependentUpon>
161161
</Compile>
162162
</ItemGroup>
163-
164-
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(MSBuildAssemblyVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
165-
166163
</Project>

0 commit comments

Comments
 (0)