Run CodeQL for every language on hosted runners, Kotlin with a build

Default setup analyses Java without a build and leaves out every Kotlin file, and the Java job on the
self-hosted runner stopped at the NDK install because sudo asks for a password, so Kotlin had not been
analysed since February. One matrix job covers actions, JavaScript/TypeScript, Rust and Java/Kotlin.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-11-03 03:56:34 +04:00
1 parent 431dc63333
commit 9ef18c745f
1 file changed
+35 -4
+35 -4
View File
@@ -26,24 +26,51 @@ env:
EHTERSCAN_API_KEY_ETHEREUM: ${{ secrets.EHTERSCAN_API_KEY_ETHEREUM }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
DWELLIR_API_KEY: ${{ secrets.DWELLIR_API_KEY }}
TRONGRID_API_KEY: ${{ secrets.TRONGRID_API_KEY }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
DEBUG_GOOGLE_OAUTH_ID: ${{ secrets.DEBUG_GOOGLE_OAUTH_ID }}
RELEASE_GOOGLE_OAUTH_ID: ${{ secrets.RELEASE_GOOGLE_OAUTH_ID }}
jobs:
codeql:
name: CodeQL Analysis
runs-on: [self-hosted, wallet]
if: github.event_name == 'push' # Only run on push, not PRs (self-hosted security)
# Advanced setup, because default setup analyses Java without a build and leaves out every
# Kotlin file, which is nearly all of this app.
name: CodeQL (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: rust
build-mode: none
- language: java-kotlin
build-mode: manual
steps:
- name: Free disk space
if: matrix.language == 'java-kotlin'
run: |
# The CodeQL bundle in the tool cache is kept: the init step below uses it.
sudo rm -rf /usr/share/dotnet /usr/share/swift /opt/ghc /usr/local/.ghcup \
/usr/local/share/boost /usr/local/share/powershell \
/usr/local/lib/node_modules /usr/local/julia* /opt/microsoft
sudo docker image prune -af > /dev/null 2>&1 || true
df -h /
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
if: matrix.language == 'java-kotlin'
uses: ./.github/workflows/install/
- name: Set up DEV Google Services
if: matrix.language == 'java-kotlin'
uses: davidSchuppa/base64Secret-toFile-action@v3
with:
secret: ${{ secrets.CI_DEVELOP_GOOGLE_SERVICES }}
@@ -53,15 +80,19 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java-kotlin
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build for CodeQL
if: matrix.build-mode == 'manual'
run: ./gradlew assembleDebug -x test -x lint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:${{ matrix.language }}
dependency-review:
name: Dependency Review