name: "CodeQL"

on:
  push:
    branches: [ develop ]

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

    strategy:
      fail-fast: false
      matrix:
        language: [ 'python' ]
        python-version: [3.6, 3.8]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
    - run: git fetch --prune --unshallow
    
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip

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

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