You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/10/12 13:19:40 UTC

[lucene] branch main updated: LUCENE-10167: Run tests on PRs (and pushes to the main branch) (#376)

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

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new dad926a  LUCENE-10167: Run tests on PRs (and pushes to the main branch) (#376)
dad926a is described below

commit dad926ad175b61c8eb7c8764309e4ff0b4fe9dc9
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Tue Oct 12 15:19:34 2021 +0200

    LUCENE-10167: Run tests on PRs (and pushes to the main branch) (#376)
---
 .github/workflows/gradle-precommit.yml | 76 +++++++++++++++++++++++++++++-----
 1 file changed, 66 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/gradle-precommit.yml b/.github/workflows/gradle-precommit.yml
index f1cc6ce..788c5cd 100644
--- a/.github/workflows/gradle-precommit.yml
+++ b/.github/workflows/gradle-precommit.yml
@@ -1,24 +1,36 @@
-name: Gradle Precommit
+name: Gradle Precommit Checks
 
 on: 
   pull_request:
     branches:
     - '*'
 
+  push:
+    branches:
+    - main
+
 jobs:
-  test:
-    name: gradle precommit w/ Java 11
+  # This runs all validation checks without tests.
+  checks:
+    name: gradle check -x test (JDK ${{ matrix.java }} on ${{ matrix.os }})
+    runs-on: ${{ matrix.os }}
 
-    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        # Operating systems to run on.
+        os: [ubuntu-latest]
+        # Test JVMs.
+        java: [ '11' ]
 
     steps:
-    # Setup
     - uses: actions/checkout@v2
 
-    - name: Set up JDK 11
-      uses: actions/setup-java@v1
+    - name: Set up JDK
+      uses: actions/setup-java@v2
       with:
-        java-version: 11
+        distribution: 'adopt-hotspot'
+        java-version: ${{ matrix.java }}
+        java-package: jdk
 
     - name: Grant execute permission for gradlew
       run: chmod +x gradlew
@@ -33,9 +45,53 @@ jobs:
           ${{ runner.os }}-gradle-
 
     - name: Initialize gradle settings
-      run: ./gradlew localSettings
+      run: ./gradlew localSettings --max-workers 2
 
     - name: Run gradle check (without tests)
-      run: ./gradlew check -x test -Ptask.times=true
+      run: ./gradlew check -x test -Ptask.times=true --max-workers 2
+
+    - uses: gradle/wrapper-validation-action@v1
+
+  # This runs all tests without any other validation checks.
+  tests:
+    name: gradle test (JDK ${{ matrix.java }} on ${{ matrix.os }})
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      matrix:
+        # Operating systems to run on.
+        # windows-latest: fairly slow to build and results in odd errors (see LUCENE-10167)
+        # macos-latest: a tad slower than ubuntu and pretty much the same (?) so leaving out.
+        os: [ubuntu-latest]
+        # Test JVMs.
+        java: [ '11' ]
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - name: Set up JDK
+      uses: actions/setup-java@v2
+      with:
+        distribution: 'adopt-hotspot'
+        java-version: ${{ matrix.java }}
+        java-package: jdk
+
+    - uses: actions/cache@v2
+      with:
+        path: |
+          ~/.gradle/caches
+        key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('versions.lock') }}
+        restore-keys: |
+          ${{ runner.os }}-gradle-precommit-
+          ${{ runner.os }}-gradle-
+
+    - name: Initialize gradle settings
+      run: ./gradlew localSettings --max-workers 2
+
+    - name: Echo settings
+      run: cat gradle.properties
+
+    - name: Run gradle tests
+      run: ./gradlew test "-Ptask.times=true" "-Ptests.slow=false" --max-workers 2
 
     - uses: gradle/wrapper-validation-action@v1