name: "CodeQL"

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
  schedule:
    - cron: '0 6 * * 1'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        language: ['java', 'javascript']

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - run: git checkout HEAD^2
      if: ${{ github.event_name == 'pull_request' }}

    - name: Setup Java
      uses: actions/setup-java@v1.4.3
      with:
        java-version: 11

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

    - name: 'Android: build devDebug'
      if: matrix.language == 'java'
      working-directory: android
      env:
        SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }}
      run: |
        gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output ./app/src/dev/google-services.json ./app/src/dev/google-services.json.gpg
        ./gradlew clean
        ./gradlew assembleDevDebug

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

name: "CodeQL"

on:
  push:
    branches: [master]
  schedule:
    - cron: '0 6 * * 1'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        language: ['java', 'javascript']

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - run: git checkout HEAD^2
      if: ${{ github.event_name == 'pull_request' }}

    - name: Setup Java
      uses: actions/setup-java@v1.4.3
      with:
        java-version: 11

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

    - name: 'Android: build devDebug'
      if: matrix.language == 'java'
      working-directory: android
      env:
        SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }}
      run: |
        gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output ./app/src/dev/google-services.json ./app/src/dev/google-services.json.gpg
        ./gradlew clean
        ./gradlew assembleDevDebug

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

Disable CodeQL for pull requests
Disable CodeQL for pull requests
