name: "CodeQL"

on:
  workflow_dispatch:
  push:
    branches: [ master ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ master ]
  schedule:
    - cron: '33 5 * * 0'

env:
  NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
        
jobs:
  analyze:
    name: Analyze
    runs-on: windows-2022
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'csharp' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
          
    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: ${{ matrix.language }}

    - uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.nuget/packages
        key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
        restore-keys: |
          ${{ runner.os }}-nuget-
     
    - name: Autobuild
      uses: github/codeql-action/autobuild@v1

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

name: "CodeQL"

on:
  workflow_dispatch:
  # Have to disable this until CodeQL is support on Server 2022
  # push:
  #   branches: [ master ]
  # pull_request:
  #   # The branches below must be a subset of the branches above
  #   branches: [ master ]
  # schedule:
  #   - cron: '33 5 * * 0'

env:
  NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
        
jobs:
  analyze:
    name: Analyze
    runs-on: windows-2022
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'csharp' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
          
    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: ${{ matrix.language }}

    - uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.nuget/packages
        key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
        restore-keys: |
          ${{ runner.os }}-nuget-
     
    - name: Autobuild
      uses: github/codeql-action/autobuild@v1

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

Disable CodeQL as 2022 isn't currently supported
Disable CodeQL as 2022 isn't currently supported
