You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/10/16 17:28:38 UTC

[maven-gh-actions-shared] branch main updated: Exclude os, jdk, distributions used in ff from matrix build

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git


The following commit(s) were added to refs/heads/main by this push:
     new f4148bc  Exclude os,jdk,distributions used in ff from matrix build
f4148bc is described below

commit f4148bc72c1a8bb8e6c1eb409c1229a7603924bf
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Sat Oct 16 14:49:31 2021 +0200

    Exclude os,jdk,distributions used in ff from matrix build
---
 .github/workflows/maven-verify-with-its.yml | 51 ++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/maven-verify-with-its.yml b/.github/workflows/maven-verify-with-its.yml
index 0975048..3a344b1 100644
--- a/.github/workflows/maven-verify-with-its.yml
+++ b/.github/workflows/maven-verify-with-its.yml
@@ -28,30 +28,63 @@ on:
 
       os-matrix:
         description: 'os matrix as json array'
+        required: false
         default: '[ "ubuntu-latest", "windows-latest", "macOS-latest" ]'
         type: string
 
       jdk-matrix:
         description: 'jdk matrix as json array'
+        required: false
         default: '[ "8", "11", "17" ]'
         type: string
 
       matrix-exclude:
         description: 'exclude for matrix as json'
+        required: false
         default: '[]'
         type: string
 
       jdk-distribution-matrix:
         description: "jdk distribution matrix"
+        required: false
         default: '[ "temurin" ]'
         type: string
 
 jobs:
 
-  build:
-    name: fail-fast-build
+  setup:
+    name: Setup
     runs-on: ubuntu-latest
 
+    outputs:
+      ff-os: ${{ steps.setup.outputs.ff-os }}
+      ff-jdk: ${{ steps.setup.outputs.ff-jdk }}
+      ff-jdk-distribution: ${{ steps.setup.outputs.ff-jdk-distribution }}
+      ff-excludes: ${{ steps.excludes.outputs.ff-excludes }}
+
+    steps:
+      # get first items from matrix for fail-fast
+      - id: setup
+        run: |
+          echo '::set-output name=ff-os::${{ fromJSON( inputs.os-matrix )[0] }}'
+          echo '::set-output name=ff-jdk::${{ fromJSON( inputs.jdk-matrix )[0] }}'
+          echo '::set-output name=ff-jdk-distribution::${{ fromJSON( inputs.jdk-distribution-matrix )[0] }}'
+
+      # prepare excludes for verify matrix in order to not run the same build twice
+      - id: excludes
+        run: |
+          EXCLUDES=$(echo '${{ inputs.matrix-exclude }}' | jq -rc '. + [{
+            "os": "${{ steps.setup.outputs.ff-os }}",
+            "jdk": "${{ steps.setup.outputs.ff-jdk }}",
+            "distribution": "${{ steps.setup.outputs.ff-jdk-distribution }}"
+          }]')
+          echo "::set-output name=ff-excludes::$EXCLUDES"
+
+  build:
+    needs: setup
+    name: ${{ needs.setup.outputs.ff-os }} jdk-${{ needs.setup.outputs.ff-jdk }}-${{ needs.setup.outputs.ff-jdk-distribution }}
+    runs-on: ${{ needs.setup.outputs.ff-os }}
+
     steps:
       - name: Checkout
         uses: actions/checkout@v2.3.4
@@ -59,15 +92,15 @@ jobs:
       - name: Set up JDK
         uses: actions/setup-java@v2.3.1
         with:
-          java-version: 8
-          distribution: 'temurin'
+          java-version: ${{ needs.setup.outputs.ff-jdk }}
+          distribution: ${{ needs.setup.outputs.ff-jdk-distribution }}
           cache: 'maven'
 
       - name: Build with Maven
         run: mvn ${{ inputs.maven_args }} verify
 
   verify:
-    needs: build
+    needs: [ setup, build ]
     name: ${{ matrix.os }} jdk-${{ matrix.jdk }}-${{ matrix.distribution }}
 
     runs-on: ${{ matrix.os }}
@@ -75,10 +108,10 @@ jobs:
     strategy:
       fail-fast: true
       matrix:
-        os:       ${{ fromJSON( inputs.os-matrix ) }}
-        jdk:      ${{ fromJSON( inputs.jdk-matrix ) }}
-        distribution:      ${{ fromJSON( inputs.jdk-distribution-matrix ) }}
-        exclude:  ${{ fromJSON( inputs.matrix-exclude ) }}
+        os: ${{ fromJSON( inputs.os-matrix ) }}
+        jdk: ${{ fromJSON( inputs.jdk-matrix ) }}
+        distribution: ${{ fromJSON( inputs.jdk-distribution-matrix ) }}
+        exclude: ${{ fromJSON( needs.setup.outputs.ff-excludes ) }}
 
     steps:
       - name: Checkout