Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Java to CodeQL scan list #1275

Merged
merged 12 commits into from
May 14, 2024
80 changes: 77 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: windows-2019
permissions:
contents: read
actions: read
Expand Down Expand Up @@ -49,8 +49,17 @@ jobs:

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

analyze-java:
reyang marked this conversation as resolved.
Show resolved Hide resolved
name: Analyze Java
runs-on: windows-latest
permissions:
contents: read
actions: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
continue-on-error: true

- name: Update submodules
run: |
git submodule sync
git config --global submodule.lib/modules.update none
git -c protocol.version=2 submodule update --init --force --depth=1

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Remove default github maven configuration
run: rm $Env:USERPROFILE\.m2\settings.xml
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install NDK
run: |
java -version
gci env:* | sort-object name
new-item "C:\Users\runneradmin\.android\repositories.cfg" -ItemType "file"
echo yes | .\sdkmanager.bat "ndk-bundle" "cmake;3.10.2.4988404" "ndk;21.4.7075529" --sdk_root=$Env:ANDROID_SDK_ROOT
working-directory: ${{ env.ANDROID_SDK_ROOT }}\cmdline-tools\7.0\bin
- name: Chocolatey
run: |
choco install --no-progress -y ninja
- name: List CMake
run: |
pwd
echo "=================="
gci -r -i "CMake*" -Name
echo "=================="
gci -r -i "gtest-all*" -Name
echo "=================="
gci third_party/ -Name
echo "=================="
gci third_party/googletest -Name
- name: Gradle Build
run: |
.\gradlew.bat maesdk:assemble app:assemble
working-directory: lib\android_build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Loading