CodeQL (daily) #498
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeQL (daily) | |
on: | |
schedule: | |
# Daily at 03:55 (UTC) | |
- cron: '55 3 * * *' | |
workflow_dispatch: | |
jobs: | |
analyze: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: touch local props | |
run: touch demo-app/local.properties | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: java | |
# using "latest" helps to keep up with the latest Kotlin support | |
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 | |
tools: linked | |
- name: Set up gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Assemble | |
# skipping build cache is needed so that all modules will be analyzed | |
run: ./gradlew assemble --no-build-cache | |
- name: Perform CodeQL analysis | |
uses: github/codeql-action/analyze@v3 | |
- name: Enable KVM for Android tests | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Run Android tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
script: ./gradlew connectedCheck | |
open-issue-on-failure: | |
# open an issue on failure because it can be easy to miss CI failure notifications | |
needs: | |
- analyze | |
if: always() | |
uses: ./.github/workflows/reusable-workflow-notification.yml | |
with: | |
success: ${{ needs.analyze.result == 'success' }} |