Skip to content

Commit a956eb9

Browse files
authored
Add Java to CodeQL scan list (#1275)
1 parent 048c905 commit a956eb9

File tree

1 file changed

+77
-3
lines changed

1 file changed

+77
-3
lines changed

Diff for: .github/workflows/codeql-analysis.yml

+77-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
jobs:
1818
analyze:
1919
name: Analyze
20-
runs-on: ubuntu-latest
20+
runs-on: windows-2019
2121
permissions:
2222
contents: read
2323
actions: read
@@ -49,8 +49,17 @@ jobs:
4949

5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
52-
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v3
52+
# - name: Autobuild
53+
# uses: github/codeql-action/autobuild@v3
54+
- name: Build
55+
env:
56+
SKIP_ARM_BUILD: 1
57+
SKIP_ARM64_BUILD: 1
58+
PlatformToolset: v142
59+
VSTOOLS_VERSION: vs2019
60+
shell: cmd
61+
if: matrix.language == 'cpp'
62+
run: build-all.bat
5463

5564
# ℹ️ Command-line programs to run using the OS shell.
5665
# 📚 https://git.io/JvXDl
@@ -63,5 +72,70 @@ jobs:
6372
# make bootstrap
6473
# make release
6574

75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v2
77+
78+
analyze-java:
79+
name: Analyze Java
80+
runs-on: windows-latest
81+
permissions:
82+
contents: read
83+
actions: read
84+
security-events: write
85+
86+
strategy:
87+
fail-fast: false
88+
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v2
92+
continue-on-error: true
93+
94+
- name: Update submodules
95+
run: |
96+
git submodule sync
97+
git config --global submodule.lib/modules.update none
98+
git -c protocol.version=2 submodule update --init --force --depth=1
99+
100+
- name: Initialize CodeQL
101+
uses: github/codeql-action/init@v3
102+
with:
103+
languages: java
104+
105+
- name: Setup Java
106+
uses: actions/setup-java@v3
107+
with:
108+
distribution: 'adopt'
109+
java-version: '11'
110+
- name: Remove default github maven configuration
111+
run: rm $Env:USERPROFILE\.m2\settings.xml
112+
- name: Setup Android SDK
113+
uses: android-actions/setup-android@v2
114+
- name: Install NDK
115+
run: |
116+
java -version
117+
gci env:* | sort-object name
118+
new-item "C:\Users\runneradmin\.android\repositories.cfg" -ItemType "file"
119+
echo yes | .\sdkmanager.bat "ndk-bundle" "cmake;3.10.2.4988404" "ndk;21.4.7075529" --sdk_root=$Env:ANDROID_SDK_ROOT
120+
working-directory: ${{ env.ANDROID_SDK_ROOT }}\cmdline-tools\7.0\bin
121+
- name: Chocolatey
122+
run: |
123+
choco install --no-progress -y ninja
124+
- name: List CMake
125+
run: |
126+
pwd
127+
echo "=================="
128+
gci -r -i "CMake*" -Name
129+
echo "=================="
130+
gci -r -i "gtest-all*" -Name
131+
echo "=================="
132+
gci third_party/ -Name
133+
echo "=================="
134+
gci third_party/googletest -Name
135+
- name: Gradle Build
136+
run: |
137+
.\gradlew.bat maesdk:assemble app:assemble
138+
working-directory: lib\android_build
139+
66140
- name: Perform CodeQL Analysis
67141
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)