Skip to content

Use older version to avoid using Java 17 #17

Use older version to avoid using Java 17

Use older version to avoid using Java 17 #17

name: Build And Test (Basic)
description: Basic build and tests for the submodules on each push and pull request
on:
push:
pull_request:
types: [opened, reopened]
env:
JAVA_VERSION: 11
jobs:
# Build the CryptoAnalysis module and run its tests
build-and-test-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Sets up Java version
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
java-version: ${{ env.JAVA_VERSION }}
# Restores Maven dependecies
- name: Restore local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Event name
run: echo ${{ github.event_name }}
- name: Run maven command
run: mvn clean verify -DrunAnalysisTests
# Build the HeadlessAndroidScanner module and run its tests
build-and-test-scanner-android:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Set up Java version
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
# Restores Maven dependecies
- name: Restore local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: List Android platforms
# run: |
# ls -lhR $ANDROID_SDK_ROOT/platforms/
# Setup Android SDK
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Copy Android platforms to test resources
run: |
cp -R $ANDROID_SDK_ROOT/platforms/* HeadlessAndroidScanner/src/test/resources/platforms/
- name: Run maven command
run: mvn clean verify -DrunAndroidTests
# Build the HeadlessJavaScanner module and run its tests using Soot
# as the static analysis framework
build-and-test-scanner-soot:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Sets up Java version
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
java-version: ${{ env.JAVA_VERSION }}
# Restores Maven dependecies
- name: Restore local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run maven command
run: mvn clean verify -DrunSootTests