From ace126c0eb9fc263a95e605eed035542520859c4 Mon Sep 17 00:00:00 2001 From: Michael Dombrowski Date: Thu, 4 Apr 2024 13:55:50 -0400 Subject: [PATCH] ci: upgrade github actions (#239) --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f95496a..a2cc2ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,18 @@ jobs: - name: Enable core.longpaths run: git config --global core.longpaths true if: matrix.os == 'windows-latest' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v2 + - uses: wagoid/commitlint-github-action@v6 if: matrix.os == 'ubuntu-latest' - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.8 + distribution: corretto + java-version: 8 + cache: maven - name: Init Submodule run: git submodule update --init - name: Maven Preprocess @@ -38,25 +40,25 @@ jobs: - name: Build with Maven run: mvn -U -ntp clean verify - name: Upload Failed Test Report for aws-greengrass-testing-features-api - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: failure() with: name: Failed Test Report ${{ matrix.os }} path: aws-greengrass-testing-features/aws-greengrass-testing-features-api/target/surefire-reports - name: Upload Failed Test Report for aws-greengrass-testing-launcher - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: failure() with: name: Failed Test Report ${{ matrix.os }} path: aws-greengrass-testing-launcher/target/surefire-reports - name: Upload Failed Test Report for aws-greengrass-testing-platform-api - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: failure() with: name: Failed Test Report ${{ matrix.os }} path: aws-greengrass-testing-platform/aws-greengrass-testing-platform-api/target/surefire-reports - name: Upload Failed Test Report for aws-greengrass-testing-platform-pillbox - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: failure() with: name: Failed Test Report ${{ matrix.os }} @@ -74,31 +76,31 @@ jobs: run: python3 .github/scripts/cover2cover.py aws-greengrass-testing-platform/aws-greengrass-testing-platform-pillbox/target/jacoco-report/jacoco.xml src/main/java > aws-greengrass-testing-platform/aws-greengrass-testing-platform-pillbox/target/jacoco-report/cobertura.xml if: matrix.os == 'ubuntu-latest' - name: Upload Coverage for aws-greengrass-testing-features-api - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' with: name: Coverage Report path: aws-greengrass-testing-features/aws-greengrass-testing-features-api/target/jacoco-report - name: Upload Coverage for aws-greengrass-testing-launcher - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' with: name: Coverage Report path: aws-greengrass-testing-launcher/target/jacoco-report - name: Upload Coverage for aws-greengrass-testing-platform-api - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' with: name: Coverage Report path: aws-greengrass-testing-platform/aws-greengrass-testing-platform-api/target/jacoco-report - name: Upload Coverage for aws-greengrass-testing-platform-pillbox - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' with: name: Coverage Report path: aws-greengrass-testing-platform/aws-greengrass-testing-platform-pillbox/target/jacoco-report - name: cobertura-report-unit-test for aws-greengrass-testing-features - uses: shaguptashaikh/cobertura-action@master + uses: 5monkeys/cobertura-action@v14 continue-on-error: true with: # The GITHUB_TOKEN for this repo @@ -117,8 +119,9 @@ jobs: show_class_names: true # Use a unique name for the report and comment report_name: Unit Tests Coverage Report for aws-greengrass-testing-features + only_changed_files: true - name: cobertura-report-unit-test for aws-greengrass-testing-launcher - uses: shaguptashaikh/cobertura-action@master + uses: 5monkeys/cobertura-action@v14 continue-on-error: true with: # The GITHUB_TOKEN for this repo @@ -137,8 +140,9 @@ jobs: show_class_names: true # Use a unique name for the report and comment report_name: Unit Tests Coverage Report for aws-greengrass-testing-launcher + only_changed_files: true - name: cobertura-report-unit-test for aws-greengrass-testing-platform-api - uses: shaguptashaikh/cobertura-action@master + uses: 5monkeys/cobertura-action@v14 continue-on-error: true with: # The GITHUB_TOKEN for this repo @@ -157,8 +161,9 @@ jobs: show_class_names: true # Use a unique name for the report and comment report_name: Unit Tests Coverage Report for aws-greengrass-testing-platform-api + only_changed_files: true - name: cobertura-report-unit-test for aws-greengrass-testing-platform-pillbox - uses: shaguptashaikh/cobertura-action@master + uses: 5monkeys/cobertura-action@v14 continue-on-error: true with: # The GITHUB_TOKEN for this repo @@ -177,22 +182,25 @@ jobs: show_class_names: true # Use a unique name for the report and comment report_name: Unit Tests Coverage Report for aws-greengrass-testing-platform-pillbox + only_changed_files: true check-binary-compatability: runs-on: ubuntu-latest steps: - name: Checkout HEAD - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 ref: ${{ github.event.pull_request.base.sha }} path: 'otf-old-japicmp' - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.8 + distribution: corretto + java-version: 8 + cache: maven - name: Build HEAD run: | cd otf-old-japicmp @@ -205,7 +213,7 @@ jobs: # Install artifacts with dummy version in local repository; used later by Maven plugin for comparison mvn --batch-mode --no-transfer-progress install -DskipTests - name: Checkout new commit - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build new commit run: | # Init Submodule @@ -220,7 +228,7 @@ jobs: python3 .github/scripts/binaryCompatibility.py --input aws-greengrass-testing-standalone/target/japicmp/default-cli.xml --token "${{ github.token }}" if: github.event_name == 'pull_request' - name: Upload Compatibility Report - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v3 with: name: Binary Compatibility Report path: aws-greengrass-testing-standalone/target/japicmp/default-cli.html @@ -239,7 +247,7 @@ jobs: git secrets --register-aws --global echo "Added aws secret templates" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run Git Secrets run: | git secrets --scan @@ -260,7 +268,7 @@ jobs: os: [ ubuntu-latest ] steps: - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::686385081908:role/aws-greengrass-testing-codebuild-uat-role-amazonlinux role-session-name: otfCI