You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/08/12 17:49:06 UTC

[GitHub] [netbeans] mbien commented on a diff in pull request #4431: conditional CI pipeline + migrate some jobs from travis to gh

mbien commented on code in PR #4431:
URL: https://github.com/apache/netbeans/pull/4431#discussion_r944683773


##########
.github/workflows/main.yml:
##########
@@ -27,65 +27,1286 @@ concurrency:
   group: ${{ github.head_ref || github.run_id }}
   cancel-in-progress: true
 
+env:
+
+  OPTS: >
+    -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
+    -Dtest-unit-sys-prop.ignore.random.failures=true
+
+  # flags for conditional, long running steps or jobs configurable with labels. If this is not a PR, everything will run.
+  # Java label
+  test_java: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+
+  # JavaDoc label
+  test_javadoc: ${{ contains(github.event.pull_request.labels.*.name, 'JavaDoc') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+
+  # JavaScript label
+  test_javascript: ${{ contains(github.event.pull_request.labels.*.name, 'JavaScript') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+
+  # PHP label
+  test_php: ${{ contains(github.event.pull_request.labels.*.name, 'PHP') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+
+  # Platform label
+  test_platform: ${{ contains(github.event.pull_request.labels.*.name, 'Platform') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+
+  # Ant, Gradle, Maven and MX labels trigger build-tools job
+  # see job condition (env vars don't work for job conditions https://github.com/actions/runner/issues/1189 )
+
+  # special commands:
+  # ci:all-tests enables everything
+  # ci:no-build disables the build job (and test jobs too)
+
 jobs:
-    
-# primary build job, most other jobs use the artifact produced here
-# artifact is only produced once in the matrix
+
+  # primary build job, most other jobs use the artifact produced here
+  # artifact is only produced once in the matrix
   base-build:
-    name: Build Clusters on JDK ${{ matrix.java }} 
+    name: Build Clusters on JDK ${{ matrix.java }}
+    if: contains(github.event.pull_request.labels.*.name, 'ci:no-build') == false
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        java: [ '11', '17' ]
+      fail-fast: false
+    steps:
+        
+      - name: Set up JDK ${{ matrix.java }} 
+        uses: actions/setup-java@v2
+        with:
+          java-version: ${{ matrix.java }} 
+          distribution: 'zulu'
+
+      - name: Caching dependencies
+        uses: actions/cache@v2
+        with:
+          path: ~/.hgexternalcache
+          key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }}
+          restore-keys: ${{ runner.os }}-
+          
+      - name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
+        uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+          submodules: false
+
+      - name: Build NetBeans
+        run: ant -quiet -Dcluster.config=release build-nozip
+
+      - name: Prepare Artifact
+        if: ${{ matrix.java == '11' }}
+        run: tar -I 'zstd -9 -T0' -cf /tmp/build.tar.zst --exclude ".git" .
+
+      - name: Upload Build
+        if: ${{ (matrix.java == '11') && success() }}
+        uses: actions/upload-artifact@v3
+        with:
+          name: build
+          path: /tmp/build.tar.zst
+          retention-days: 1
+          if-no-files-found: error
+
+
+# secondary jobs
+  linux-commit-validation:
+    name: Commit Validation on Linux/JDK ${{ matrix.java }}
+    needs: base-build
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        java: [ '8', '11', '17', '19-ea' ]
+      fail-fast: false
+    steps:
+
+      - name: Set up JDK ${{ matrix.java }} 
+        uses: actions/setup-java@v2
+        with:
+          java-version: ${{ matrix.java }} 
+          distribution: 'zulu'
+
+      - name: Setup Xvfb
+        if: ${{ matrix.java != '19-ea' }}  # see #4299
+        run: |
+          echo "DISPLAY=:99.0" >> $GITHUB_ENV
+          Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
+
+      - name: Download Build
+        uses: actions/download-artifact@v3
+        with:
+          name: build
+
+      - name: Extract
+        run: tar --zstd -xf build.tar.zst
+
+      - name: Commit Validation tests
+        run: ant $OPTS -Dcluster.config=release commit-validation
+
+      - name: Create Test Summary
+        uses: test-summary/action@v1
+        if: failure()
+        with:
+          paths: "./nbbuild/build/test/commit-validation/results/*.xml"
+
+# the test-summary action above is currently only looking for failures and ignores errors,
+# this step can be removed as soon this is fixed upstream
+      - name: Upload Test Results
+        if: failure()
+        uses: actions/upload-artifact@v3
+        with:
+          name: validation-log-linux-${{ matrix.java }}
+          path: /home/runner/work/netbeans/netbeans/nbbuild/build/test/commit-validation/results/
+          retention-days: 1
+
+
+  paperwork:
+    name: Check Paperwork on Linux/JDK ${{ matrix.java }}
+    needs: base-build
+    runs-on: ubuntu-latest
+    env:
+      ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
+    strategy:
+      matrix:
+        java: [ '11' ]
+    steps:
+
+      - name: Set up JDK ${{ matrix.java }} 
+        uses: actions/setup-java@v2
+        with:
+          java-version: ${{ matrix.java }} 
+          distribution: 'zulu'
+
+      - name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
+        uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+          submodules: false
+          fetch-depth: 10
+
+      - name: Print last 10 Commits
+        if: github.event_name == 'pull_request'
+        run: git log --oneline -n10 --pretty=format:'%h %an [%ae] %s'

Review Comment:
   the new Paperwork job will print the header of the last 10 commits. This allows reviewers to quickly check if the author info is valid.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists