Skip to content

Merge pull request #664 from soot-oss/add/intraprocedural #1486

Merge pull request #664 from soot-oss/add/intraprocedural

Merge pull request #664 from soot-oss/add/intraprocedural #1486

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
types:
- opened
- reopened
- synchronize
- ready_for_review
#cancel a running workflow if something new is pushed for the branch (to save calculation time budget)
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Code coverage (i.e. jacoco) needs the same classes for its test otherwise its classids can possibly not match
Compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: cache maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache compilation
id: cache-compilation
uses: actions/cache@v3
with:
path: |
**/target/
key: cache-compilation-${{ github.sha }}
- name: Build with JDK8
run: mvn -B compile -Dfmt.skip -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
JDK8:
needs: Compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get cached compilation
id: cache-compilation
uses: actions/cache@v3
with:
path: |
**/target/
key: cache-compilation-${{ github.sha }}
- name: cache maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
- name: Test (JDK8)
run: mvn -am verify -B -Dfmt.skip -Dmaven.main.skip=true -PJava8 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: coverage-exec
path: |
*/target/coverage-reports/jacoco-ut-jdk8.exec
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-reports-jdk8
path: |
*/target/surefire-reports
JDK9:
needs: Compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get cached compilation
id: cache-compilation
uses: actions/cache@v3
with:
path: |
**/target/
key: cache-compilation-${{ github.sha }}
- name: cache maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 9
uses: actions/setup-java@v3
with:
java-version: '9'
distribution: 'zulu'
- name: Test (JDK9)
run: mvn -B -am verify -Dfmt.skip -Dmaven.main.skip=true -PJava9 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: coverage-exec
path: |
*/target/coverage-reports/jacoco-ut-jdk9.exec
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-reports-jdk9
path: |
*/target/surefire-reports
# style check is not clean here but does not consume additional time as the other parallel running tests take (way) longer
- name: Check Format
run: mvn -B com.coveo:fmt-maven-plugin:check -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
# takes a long time to run - so just run them when PR is not draft anymore
IntegrationTest:
if: ${{ !github.event.pull_request.draft }}
needs: Compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
- name: get cached compilation
id: cache-compilation
uses: actions/cache@v3
with:
path: |
**/target/
key: cache-compilation-${{ github.sha }}
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Test (IntegrationTest)
run: mvn -B -pl sootup.tests -am verify -Dfmt.skip -Dmaven.main.skip=true -PIntegrationTest -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: coverage-exec
path: |
*/target/coverage-reports/jacoco-ut-integrationtest.exec
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-reports-integrationtest
path: |
*/target/surefire-reports
CoverageReport:
runs-on: ubuntu-latest
needs: [ JDK9, JDK8, IntegrationTest]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
- name: cache maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: get cached compilation
id: cache-compilation
uses: actions/cache@v3
with:
path: |
**/target/
key: cache-compilation-${{ github.sha }}
- name: Download uploaded exec artifacts
uses: actions/download-artifact@v3
with:
name: coverage-exec
- name: merge coverage reports
run: mvn -ntp jacoco:merge@merge-results
- name: aggregate coverage reports across java versions
run: mvn -ntp jacoco:report-aggregate@generate-coverage-report
- name: upload aggregated coverage artifact
uses: actions/upload-artifact@v3
with:
name: aggregated-coverage-report
path: sootup.report/target/jacoco-aggregate/
- name: jacoco-badge-generator
id: jacoco
uses: cicirello/[email protected]
with:
jacoco-csv-file: sootup.report/target/jacoco-aggregate/jacoco.csv
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: sootup.report/target/jacoco-aggregate/jacoco.xml
publish-javadoc:
needs: Compilation
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: gh-pages
java-version: 17
target-folder: apidocs