Skip to content

CodeQL

CodeQL #335

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "root" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "root" ]
schedule:
- cron: '26 5 * * 2'
jobs:
analyze-web:
name: Analyze Web
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
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.
# 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
# queries: security-extended,security-and-quality
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
with:
dotnet-version: 8.0.303
- name: Restore web dependencies
run: dotnet restore --locked-mode CurrentTimeApp/CurrentTimeApp.csproj
- name: Build web
run: dotnet build -c Release --no-restore CurrentTimeApp/CurrentTimeApp.csproj
- name: Publish web application
run: dotnet publish -c Release -o release CurrentTimeApp/CurrentTimeApp.csproj
analyze-maui:
name: Analyze MAUI
runs-on: windows-latest
defaults:
run:
shell: pwsh
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
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.
# 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
# queries: security-extended,security-and-quality
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
with:
dotnet-version: 8.0.303
- name: Install dotnet maui workload
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Install dotnet maui-android workload to build application
run: dotnet workload restore CurrentTimeApp.MauiBlazor/CurrentTimeApp.MauiBlazor.csproj
- name: Restore android dependencies
run: dotnet restore --locked-mode CurrentTimeApp.MauiBlazor/CurrentTimeApp.MauiBlazor.csproj
- name: Build android app
run: dotnet build -c Release --no-restore -f net8.0-android CurrentTimeApp.MauiBlazor/CurrentTimeApp.MauiBlazor.csproj
- name: Publish android application
run: dotnet publish -c Release -o android-release -f net8.0-android CurrentTimeApp.MauiBlazor/CurrentTimeApp.MauiBlazor.csproj
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
with:
category: "/language:${{matrix.language}}"