CodeQL #5
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 | |
on: | |
pull_request: | |
branches: | |
- main | |
- release/* | |
push: | |
branches: | |
- main | |
- release/* | |
schedule: | |
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday | |
permissions: | |
contents: read | |
jobs: | |
analyze: | |
permissions: | |
contents: read | |
actions: read # for github/codeql-action/init to get workflow details | |
security-events: write # for github/codeql-action/analyze to upload SARIF results | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Java 17 | |
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Set up gradle | |
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 | |
- name: touch local props | |
run: touch demo-app/local.properties | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 | |
with: | |
languages: java, actions | |
# using "linked" helps to keep up with the latest Kotlin support | |
# (see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 | |
# and note that "latest" was renamed to "linked" in https://github.com/github/codeql-action/pull/2281) | |
tools: linked | |
- name: Assemble | |
# --no-build-cache is required for codeql to analyze all modules | |
# --no-daemon is required for codeql to observe the compilation | |
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands) | |
run: ./gradlew assemble --no-build-cache --no-daemon | |
- name: Perform CodeQL analysis | |
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 | |
- 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@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 | |
with: | |
api-level: 29 | |
script: ./gradlew connectedCheck |