name: "CodeQL"

on:
  schedule:
    - cron: '0 0 * * 4'

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

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

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

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: ${{ matrix.language }}

    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1

    - name: Build with dotnet
      run: dotnet build -bl -c Release -m:1 src/RoslynPad.sln

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