Skip to content

Commit 027a712

Browse files
committed
Add CodeQL
1 parent 3c34cac commit 027a712

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/codeql.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "trunk" ]
6+
pull_request:
7+
branches: [ "trunk" ]
8+
schedule:
9+
- cron: '33 23 * * 4'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
# Runner size impacts CodeQL analysis time. To learn more, please see:
15+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
16+
# - https://gh.io/supported-runners-and-hardware-resources
17+
# - https://gh.io/using-larger-runners (GitHub.com only)
18+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
19+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
20+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
21+
permissions:
22+
# required for all workflows
23+
security-events: write
24+
25+
# required to fetch internal or private CodeQL packs
26+
packages: read
27+
28+
# only required for workflows in private repositories
29+
actions: read
30+
contents: read
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- language: java-kotlin
37+
build-mode: manual
38+
- language: ruby
39+
build-mode: none
40+
- language: swift
41+
build-mode: autobuild
42+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
43+
# Use `c-cpp` to analyze code written in C, C++ or both
44+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
45+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
46+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
47+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
48+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
49+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
# Initializes the CodeQL tools for scanning.
55+
- name: Initialize CodeQL
56+
uses: github/codeql-action/init@v3
57+
with:
58+
languages: ${{ matrix.language }}
59+
build-mode: ${{ matrix.build-mode }}
60+
# If you wish to specify custom queries, you can do so here or in a config file.
61+
# By default, queries listed here will override any specified in a config file.
62+
# Prefix the list here with "+" to use these queries and those in the config file.
63+
64+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
65+
# queries: security-extended,security-and-quality
66+
67+
- if: matrix.language == 'java-kotlin'
68+
shell: bash
69+
run: |
70+
make setup-rust-android-targets
71+
cd native/kotlin
72+
./gradlew cargoBuildAll
73+
74+
- if: matrix.language == 'java-kotlin'
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v3
77+
with:
78+
category: "/language:${{matrix.language}}"
79+
paths:
80+
- native/kotlin
81+
82+
83+
- if: matrix.language == 'swift'
84+
shell: bash
85+
run: |
86+
make xcframework
87+
88+
- if: matrix.language == 'swift'
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@v3
91+
with:
92+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)