You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2020/10/09 20:16:04 UTC

[accumulo] branch 1.10 updated: Update CI jobs to build PRs and see failure logs

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

ctubbsii pushed a commit to branch 1.10
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.10 by this push:
     new 49b7cd6  Update CI jobs to build PRs and see failure logs
49b7cd6 is described below

commit 49b7cd67f49cccb61e0c1e2a487c1be3de69546d
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Fri Oct 9 16:10:51 2020 -0400

    Update CI jobs to build PRs and see failure logs
    
    * Add `if: failure()` to upload-artifact tasks so we get the logs for
      failed tasks
    * Allow input for the ref to build for manually triggered jobs (so we
      can build PRs)
    * Show the first git log message to ensure we can verify upon inspection
      that the chosen ref was built
---
 .github/workflows/maven-full-its.yaml  | 129 +++++++++++++++++++++++++++++++++
 .github/workflows/maven-on-demand.yaml |  15 +++-
 .github/workflows/maven.yaml           |  32 +++++++-
 3 files changed, 174 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/maven-full-its.yaml b/.github/workflows/maven-full-its.yaml
new file mode 100644
index 0000000..4e311f4
--- /dev/null
+++ b/.github/workflows/maven-full-its.yaml
@@ -0,0 +1,129 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This workflow will build a Java project with Maven
+# See also:
+#   https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+#   https://docs.github.com/en/actions/reference/events-that-trigger-workflows#manual-events
+#   https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson
+
+name: Full ITs
+
+on:
+  workflow_dispatch:
+    inputs:
+      buildRef:
+        description: Ref to build
+        required: true
+        default: refs/heads/main
+      numITsPerTask:
+        description: Number of ITs per task
+        required: true
+        default: 15
+
+jobs:
+  # fast build to populate the local maven repository cache
+  fastbuild:
+    timeout-minutes: 20
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        ref: ${{ github.event.inputs.buildRef }}
+    - name: Set up JDK 11
+      uses: actions/setup-java@v1
+      with:
+        java-version: 11
+    - name: Cache local maven repository
+      uses: actions/cache@v2
+      with:
+        path: |
+          ~/.m2/repository/
+          !~/.m2/repository/org/apache/accumulo
+        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+        restore-keys: ${{ runner.os }}-m2
+    - name: Show the first log message
+      run: git log -n1
+    - name: Build with Maven (Fast Build)
+      run: mvn -B -V -e -ntp "-Dstyle.color=always" clean package dependency:resolve -PskipQA
+      env:
+        MAVEN_OPTS: -Djansi.force=true
+  creatematrix:
+    needs: fastbuild
+    timeout-minutes: 5
+    outputs:
+      matrix: ${{ steps.set-matrix.outputs.matrix }}
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        ref: ${{ github.event.inputs.buildRef }}
+    - id: set-matrix
+      name: Create the IT build matrix
+      run: contrib/ci/it-matrix.sh ${{ github.event.inputs.numITsPerTask }}
+  # targeted builds that tests groups of ITs
+  mvn:
+    needs: creatematrix
+    strategy:
+      matrix: ${{ fromJson(needs.creatematrix.outputs.matrix) }}
+      fail-fast: false
+    timeout-minutes: 60
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        ref: ${{ github.event.inputs.buildRef }}
+    - name: Set up JDK 11
+      uses: actions/setup-java@v1
+      with:
+        java-version: 11
+    - name: Cache local maven repository
+      uses: actions/cache@v2
+      with:
+        path: |
+          ~/.m2/repository/
+          !~/.m2/repository/org/apache/accumulo
+        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+        restore-keys: ${{ runner.os }}-m2
+    - name: Build with Maven (${{ matrix.profile.its }})
+      run: mvn -B -V -e -ntp "-Dstyle.color=always" verify -PskipQA -DskipTests=false -DskipITs=false -Dtest=nomatchingtest -Dit.test="${{ matrix.profile.its }}"
+      env:
+        MAVEN_OPTS: -Djansi.force=true
+    - name: Upload unit test results
+      if: ${{ failure() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: surefire-reports-${{ matrix.profile.name }}
+        path: ./**/target/surefire-reports/
+        if-no-files-found: ignore
+    - name: Upload integration test results
+      if: ${{ failure() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: failsafe-reports-${{ matrix.profile.name }}
+        path: ./**/target/failsafe-reports/
+        if-no-files-found: ignore
+    - name: Upload mini test logs
+      if: ${{ failure() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: mini-tests-logs-${{ matrix.profile.name }}
+        path: ./**/target/**/mini-tests/**/logs/
+        if-no-files-found: ignore
+
diff --git a/.github/workflows/maven-on-demand.yaml b/.github/workflows/maven-on-demand.yaml
index 34af0df..0315ed3 100644
--- a/.github/workflows/maven-on-demand.yaml
+++ b/.github/workflows/maven-on-demand.yaml
@@ -18,7 +18,9 @@
 #
 
 # 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
+# See also:
+#   https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+#   https://docs.github.com/en/actions/reference/events-that-trigger-workflows#manual-events
 
 name: Manual Build
 
@@ -27,6 +29,10 @@ on:
     # these inputs break down the Maven command-line, somewhat arbitrarily, so
     # the UI when starting a run is easier to use
     inputs:
+      buildRef:
+        description: Ref to build
+        required: true
+        default: refs/heads/main
       mvnOpts:
         description: Maven options
         required: true
@@ -55,6 +61,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2
+      with:
+        ref: ${{ github.event.inputs.buildRef }}
     - name: Set up JDK 11
       uses: actions/setup-java@v1
       with:
@@ -67,23 +75,28 @@ jobs:
           !~/.m2/repository/org/apache/accumulo
         key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
         restore-keys: ${{ runner.os }}-m2
+    - name: Show the first log message
+      run: git log -n1
     - name: Build with Maven
       run: mvn -B -V -e -ntp "-Dstyle.color=always" ${{ github.event.inputs.mvnOpts }} ${{ github.event.inputs.goals }} ${{ github.event.inputs.utOpts }} ${{ github.event.inputs.itOpts }} ${{ github.event.inputs.addOpts }}
       env:
         MAVEN_OPTS: -Djansi.force=true
     - name: Upload unit test results
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: surefire-reports
         path: ./**/target/surefire-reports/
         if-no-files-found: ignore
     - name: Upload integration test results
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: failsafe-reports
         path: ./**/target/failsafe-reports/
         if-no-files-found: ignore
     - name: Upload mini test logs
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: mini-tests-logs
diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml
index cd06d1a..5b7cdb3 100644
--- a/.github/workflows/maven.yaml
+++ b/.github/workflows/maven.yaml
@@ -18,7 +18,8 @@
 #
 
 # 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
+# See also:
+#   https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
 
 name: QA
 
@@ -29,7 +30,33 @@ on:
     branches: [ '1.*' ]
 
 jobs:
+  # fast build to populate the local maven repository cache
+  fastbuild:
+    timeout-minutes: 20
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up JDK 11
+      uses: actions/setup-java@v1
+      with:
+        java-version: 11
+    - name: Cache local maven repository
+      uses: actions/cache@v2
+      with:
+        path: |
+          ~/.m2/repository/
+          !~/.m2/repository/org/apache/accumulo
+        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+        restore-keys: ${{ runner.os }}-m2
+    - name: Show the first log message
+      run: git log -n1
+    - name: Build with Maven (Fast Build)
+      run: mvn -B -V -e -ntp "-Dstyle.color=always" clean package dependency:resolve -PskipQA
+      env:
+        MAVEN_OPTS: -Djansi.force=true
+  # more complete builds with tests
   mvn:
+    needs: fastbuild
     strategy:
       matrix:
         profile:
@@ -57,18 +84,21 @@ jobs:
       env:
         MAVEN_OPTS: -Djansi.force=true
     - name: Upload unit test results
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: surefire-reports-${{ matrix.profile.name }}
         path: ./**/target/surefire-reports/
         if-no-files-found: ignore
     - name: Upload integration test results
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: failsafe-reports-${{ matrix.profile.name }}
         path: ./**/target/failsafe-reports/
         if-no-files-found: ignore
     - name: Upload mini test logs
+      if: ${{ failure() }}
       uses: actions/upload-artifact@v2
       with:
         name: mini-tests-logs-${{ matrix.profile.name }}