From a5b88cafb9b1cf1ca8d8c122c7ec7d6782e67ca8 Mon Sep 17 00:00:00 2001 From: Sven Meyer Date: Thu, 14 Nov 2024 13:16:29 +0100 Subject: [PATCH] Integrate merge queue actions --- .github/workflows/build_analysis.yml | 31 ------------ .github/workflows/build_and_test.yml | 60 +++++++++++++++++++++++ .github/workflows/build_soot.yml | 32 ------------ .github/workflows/deploy_and_release.yml | 2 +- .github/workflows/merge_queue_mac.yml | 33 +++++++++++-- .github/workflows/merge_queue_ubuntu.yml | 31 +++++++++++- .github/workflows/merge_queue_windows.yml | 31 +++++++++++- .github/workflows/test.yml | 2 +- .github/workflows/version.yml | 6 +-- 9 files changed, 153 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/build_analysis.yml create mode 100644 .github/workflows/build_and_test.yml delete mode 100644 .github/workflows/build_soot.yml diff --git a/.github/workflows/build_analysis.yml b/.github/workflows/build_analysis.yml deleted file mode 100644 index 5402c9886..000000000 --- a/.github/workflows/build_analysis.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build And Test (Analysis) - -on: - push: - pull_request: - types: [opened, reopened] - -jobs: - # This name has to be equal to the one in the merge queue - 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 - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-package: jdk - java-version: '11' - # 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 -DrunAnalysisTests diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 000000000..57be3815e --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,60 @@ +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 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-package: jdk + java-version: $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 -DrunAnalysisTests + + # 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 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-package: jdk + java-version: $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 diff --git a/.github/workflows/build_soot.yml b/.github/workflows/build_soot.yml deleted file mode 100644 index 8e89061a8..000000000 --- a/.github/workflows/build_soot.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build And Test (Soot) - -on: - push: - pull_request: - types: [opened, reopened] - -jobs: - # Builds the project in ubuntu - build: - runs-on: ubuntu-latest - name: Project build in ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v4 - # Sets up Java version - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-package: jdk - java-version: '11' - # 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 diff --git a/.github/workflows/deploy_and_release.yml b/.github/workflows/deploy_and_release.yml index c228b093e..beffcd7d8 100644 --- a/.github/workflows/deploy_and_release.yml +++ b/.github/workflows/deploy_and_release.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-package: 'jdk' diff --git a/.github/workflows/merge_queue_mac.yml b/.github/workflows/merge_queue_mac.yml index fea43f23f..e3eedc424 100644 --- a/.github/workflows/merge_queue_mac.yml +++ b/.github/workflows/merge_queue_mac.yml @@ -3,8 +3,11 @@ name: Build And Test (MacOS) on: merge_group: +env: + JAVA_VERSION: 11 + jobs: - # This name must be equal to the corresponding build_analysis job + # This name must be equal to the corresponding build_and_test action build-and-test-analysis: runs-on: macos-latest steps: @@ -16,7 +19,31 @@ jobs: with: distribution: 'adopt' java-package: jdk - java-version: '11' + java-version: $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 -DrunAnalysisTests + + # This name must be equal to the corresponding build_and_test action + build-and-test-scanner-soot: + runs-on: macos-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + # Sets up Java version + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-package: jdk + java-version: $JAVA_VERSION # Restores Maven dependecies - name: Restore local Maven repository uses: actions/cache@v4 @@ -26,4 +53,4 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Run maven command - run: mvn clean verify \ No newline at end of file + run: mvn clean verify -DrunSootTests \ No newline at end of file diff --git a/.github/workflows/merge_queue_ubuntu.yml b/.github/workflows/merge_queue_ubuntu.yml index deb61d8dc..ec1babaeb 100644 --- a/.github/workflows/merge_queue_ubuntu.yml +++ b/.github/workflows/merge_queue_ubuntu.yml @@ -3,8 +3,11 @@ name: Build And Test (Ubuntu) on: merge_group: +env: + JAVA_VERSION: 11 + jobs: - # This name must be equal to the corresponding build_analysis job + # This name must be equal to the corresponding build_and_test job build-and-test-analysis: runs-on: ubuntu-latest steps: @@ -26,4 +29,28 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Run maven command - run: mvn clean verify \ No newline at end of file + run: mvn clean verify -DrunAnalysisTests + + # This name must be equal to the corresponding build_and_test job + 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 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-package: jdk + java-version: $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 diff --git a/.github/workflows/merge_queue_windows.yml b/.github/workflows/merge_queue_windows.yml index 916c8bf7a..62b679a3d 100644 --- a/.github/workflows/merge_queue_windows.yml +++ b/.github/workflows/merge_queue_windows.yml @@ -3,8 +3,11 @@ name: Build And Test (Windows) on: merge_group: +env: + JAVA_VERSION: 11 + jobs: - # This name must be equal to the corresponding build_analysis job + # This name must be equal to the corresponding build_and_test job build-and-test-analysis: runs-on: windows-latest steps: @@ -26,4 +29,28 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Run maven command - run: mvn clean verify \ No newline at end of file + run: mvn clean verify -DrunAnalysisTests + + # This name must be equal to the corresponding build_and_test job + build-and-test-scanner-soot: + runs-on: windows-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + # Sets up Java version + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-package: jdk + java-version: $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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a345dfd22..4c8cfaa76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: name: Test CryptoAnalysis Action steps: - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run CogniCrypt uses: ./ with: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 47e52e807..a2ec7193e 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Sets up Java version - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-package: jdk @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Semantic versioning