Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.

Commit a5d672a

Browse files
authored
chore: configure CodeQL (#581)
* fix: configure CodeQL with buildless extraction for java-kotlin - Use build-mode: none for java-kotlin to avoid Gradle build issues - Set up Java 17 to ensure Gradle compatibility if needed - Add javascript-typescript analysis for TypeScript source code Fixes CodeQL autobuild failure caused by Gradle 9.2.1 requiring JVM 17+ while autobuild incorrectly selected JVM 8 based on sourceCompatibility. * chore: remove javascript-typescript from CodeQL workflow * fix: use manual build with proper React Native setup for CodeQL - Set up Node.js and install dependencies - Build from example/android which includes the library - This allows CodeQL to trace the Kotlin compilation * fix: generate Gradle wrapper before build The gradle-wrapper.jar is not committed to the repo * chore: add caching and use latest LTS Node - Add Gradle caching via setup-java - Add Yarn caching via setup-node - Use lts/* for latest LTS Node version - Use --frozen-lockfile for reproducible installs * fix: download Gradle wrapper jar instead of using system Gradle The system Gradle 9.2.1 has Kotlin 2.2.x which is incompatible with React Native's gradle-plugin that requires Kotlin 1.9.x. Download the wrapper jar for Gradle 8.10.2 directly instead. * chore: use gradle/actions/setup-gradle for proper Gradle setup with caching Replaces manual wrapper jar download with the official Gradle action which handles wrapper installation and provides automatic caching. * fix: specify gradle-version and use gradle command directly The wrapper jar is not in the repo, so use the installed Gradle directly instead of relying on the wrapper. * chore: use GitHub's advanced setup template with manual java-kotlin build - Matrix strategy for java-kotlin, javascript-typescript, and ruby - Manual build mode for java-kotlin with proper Gradle setup - build-mode: none for JS/TS and Ruby - Updated to codeql-action v4
1 parent b2c91e1 commit a5d672a

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
schedule:
9+
- cron: "42 9 * * 1"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
packages: read
18+
actions: read
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: java-kotlin
26+
build-mode: manual
27+
- language: javascript-typescript
28+
build-mode: none
29+
- language: ruby
30+
build-mode: none
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Java 17
37+
if: matrix.language == 'java-kotlin'
38+
uses: actions/setup-java@v4
39+
with:
40+
distribution: "temurin"
41+
java-version: "17"
42+
43+
- name: Set up Gradle
44+
if: matrix.language == 'java-kotlin'
45+
uses: gradle/actions/setup-gradle@v4
46+
with:
47+
gradle-version: "8.10.2"
48+
49+
- name: Set up Node.js
50+
if: matrix.language == 'java-kotlin'
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: "lts/*"
54+
cache: "yarn"
55+
56+
- name: Install dependencies
57+
if: matrix.language == 'java-kotlin'
58+
run: |
59+
yarn install --frozen-lockfile
60+
cd example && yarn install --frozen-lockfile
61+
62+
- name: Initialize CodeQL
63+
uses: github/codeql-action/init@v4
64+
with:
65+
languages: ${{ matrix.language }}
66+
build-mode: ${{ matrix.build-mode }}
67+
68+
- name: Build Android
69+
if: matrix.build-mode == 'manual'
70+
run: gradle --no-daemon assembleDebug
71+
working-directory: example/android
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v4
75+
with:
76+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)