HaloSPV3/HCE

View on GitHub
.github/workflows/codeql-analysis-spv3.yml

Summary

Maintainability
Test Coverage
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL - SPV3"

on:
  push:
    branches: [ main, develop ]
    paths:
    - 'hxe/kernel/src/**'
    - 'spv3/loader/src/**'
    - '.github/codeql/codeql-config.yml'
    # Ignore
    - '!**.ico'
    - '!**.jpg'
    - '!**.png'
    - '!**.md'
    - '!**.txt'
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ main, develop ]
    paths:
    - 'hxe/kernel/src/**'
    - 'spv3/loader/src/**'
    - '.github/codeql/codeql-config.yml'
    # Ignore
    - '!**.ico'
    - '!**.jpg'
    - '!**.png'
    - '!**.md'
    - '!**.txt'
    # https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#avoiding-unnecessary-scans-of-pull-requests
  schedule:
    - cron: '35 19 * * 6'

jobs:
  analyze:
    name: Analyze
    runs-on: windows-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'csharp' ]
          # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
          # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
        solution: [ 'hxe', 'spv3' ]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Checkout Git Submodules
        run: git submodule update --init --recursive

      - name: Add msbuild to PATH
        uses: microsoft/setup-msbuild@v1

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v1
        with:
          config-file: .github/codeql/codeql-config.yml
          languages: ${{ matrix.language }}

      # -p:UseSharedCompilation=false is necessary for CodeQL to analyze .NET Framework builds.
      # See #5 in https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow#no-code-found-during-the-build
      - name: Build Solutions
        run: |
         if (${{ matrix.solution }} -eq 'spv3')  {
         cd ./spv3/loader/src/;
         msbuild.exe -restore -p:platform="Any CPU" -p:configuration="Debug" -p:UseSharedCompilation=False -detailedSummary:True SPV3.sln
         };
         if (${{ matrix.solution }} -eq 'hxe')  {
         cd ./hxe/kernel/src/;
         msbuild.exe -restore -p:platform="Any CPU" -p:configuration="Debug" -p:UseSharedCompilation=False -detailedSummary:True HXE.sln;
         };


      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v1