This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new c62545b8b00 build: GHA: sync from main (#4242)
c62545b8b00 is described below
commit c62545b8b003e284c2e35f26370ef4b9c83d7cc2
Author: David Smiley <[email protected]>
AuthorDate: Fri Mar 27 22:13:04 2026 -0400
build: GHA: sync from main (#4242)
Replaced .github/workflows and actions with contents from main branch.
Using Java 11, and need to reference the Prometheus Exporter in one place. I
didn't include "labeler" or "stale" or docker publish.
---
.github/actions/prepare-for-build/action.yml | 40 +++++++++++++++++++++++++++
.github/workflows/bin-solr-test.yml | 30 ++++++--------------
.github/workflows/docker-test.yml | 33 ++++++----------------
.github/workflows/gradle-extraction-check.yml | 22 +--------------
.github/workflows/gradle-precommit.yml | 37 +++++--------------------
.github/workflows/solrj-test.yml | 31 ++++++---------------
.github/workflows/tests-via-crave.yml | 5 ++--
.github/workflows/validate-changelog.yml | 23 +--------------
8 files changed, 75 insertions(+), 146 deletions(-)
diff --git a/.github/actions/prepare-for-build/action.yml
b/.github/actions/prepare-for-build/action.yml
new file mode 100644
index 00000000000..ebddc8d5ca7
--- /dev/null
+++ b/.github/actions/prepare-for-build/action.yml
@@ -0,0 +1,40 @@
+# This composite action is included in other workflows to have a shared setup
+# for java, gradle, caches, etc.
+
+name: Prepare build
+description: Creates a shared setup for other workflows
+
+inputs:
+ java-version:
+ required: false
+ default: "11"
+ description: "The default JDK version to set up."
+
+ java-distribution:
+ required: false
+ default: "temurin"
+ description: "The default JDK distribution type"
+
+runs:
+ using: "composite"
+ steps:
+ - name: Set up Java (${{ inputs.java-distribution }}, ${{
inputs.java-version }})"
+ uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #
v4.7.1
+ with:
+ distribution: ${{ inputs.java-distribution }}
+ java-version: ${{ inputs.java-version }}
+ java-package: jdk
+
+ - name: Cache gradle-wrapper.jar
+ uses: actions/cache@v4
+ with:
+ path: gradle/wrapper/gradle-wrapper.jar
+ key: gradle-wrapper-${{
hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
+
+ # This includes "smart" caching of gradle dependencies.
+ - name: Set up Gradle
+ uses:
gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
+ with:
+ # increase expiry time for the temp. develocity token.
+ #
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#increasing-the-expiry-time-for-develocity-access-tokens
+ develocity-token-expiry: 8
diff --git a/.github/workflows/bin-solr-test.yml
b/.github/workflows/bin-solr-test.yml
index f885b7da236..fea033015ab 100644
--- a/.github/workflows/bin-solr-test.yml
+++ b/.github/workflows/bin-solr-test.yml
@@ -3,8 +3,7 @@ name: Solr Script Tests
on:
pull_request:
branches:
- - 'main'
- - 'branch_*'
+ - '*'
paths:
- '.github/workflows/bin-solr-test.yml'
- 'solr/bin/**'
@@ -17,30 +16,17 @@ jobs:
name: Run Solr Script Tests
runs-on: ubuntu-latest
+ timeout-minutes: 40
steps:
- # Setup
- - uses: actions/checkout@v5
- - name: Set up JDK 11
- uses: actions/setup-java@v5
- with:
- distribution: 'temurin'
- java-version: 11
- java-package: jdk
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v5
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
- - uses: actions/cache@v5
- with:
- path: |
- ~/.gradle/caches
- key: ${{ runner.os }}-gradle-binsolr-${{ hashFiles('versions.lock') }}
- restore-keys: |
- ${{ runner.os }}-gradle-binsolr-
- ${{ runner.os }}-gradle-
+ - name: Checkout code
+ uses: actions/checkout@v5
+
+ - uses: ./.github/actions/prepare-for-build
+
- name: Test the bin/solr script
run: ./gradlew integrationTests
+
- name: Archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v6
diff --git a/.github/workflows/docker-test.yml
b/.github/workflows/docker-test.yml
index 5db95b0eb6f..aebbde1efb3 100644
--- a/.github/workflows/docker-test.yml
+++ b/.github/workflows/docker-test.yml
@@ -3,12 +3,10 @@ name: Docker Build & Test
on:
pull_request:
branches:
- - 'main'
- - 'branch_*'
+ - '*'
paths:
- '.github/workflows/docker-test.yml'
- 'solr/bin/**'
- - 'solr/prometheus-exporter/bin/**'
- 'solr/docker/**'
- 'solr/packaging/**'
@@ -17,35 +15,20 @@ jobs:
name: Build and test Docker image
runs-on: ubuntu-latest
+ timeout-minutes: 15
env:
SOLR_DOCKER_IMAGE_REPO: github-pr/solr
SOLR_DOCKER_IMAGE_TAG: ${{github.event.number}}
steps:
- # Setup
- - uses: actions/checkout@v5
- - name: Set up JDK 11
- uses: actions/setup-java@v5
- with:
- distribution: 'temurin'
- java-version: 11
- java-package: jdk
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v5
- - name: Install ACL
- run: sudo apt-get install acl
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
- - uses: actions/cache@v5
- with:
- path: |
- ~/.gradle/caches
- key: ${{ runner.os }}-gradle-docker-${{ hashFiles('versions.lock') }}
- restore-keys: |
- ${{ runner.os }}-gradle-docker-
- ${{ runner.os }}-gradle-
+ - name: Checkout code
+ uses: actions/checkout@v5
+
+ - uses: ./.github/actions/prepare-for-build
+
- name: Build Docker image with Gradle
run: ./gradlew solr:docker:docker
+
- name: Run tests on Docker image
run: ./gradlew solr:docker:testDocker
diff --git a/.github/workflows/gradle-extraction-check.yml
b/.github/workflows/gradle-extraction-check.yml
index e86c7b6f743..9c18a01c680 100644
--- a/.github/workflows/gradle-extraction-check.yml
+++ b/.github/workflows/gradle-extraction-check.yml
@@ -19,27 +19,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v5
- - name: Set up JDK 11
- uses: actions/setup-java@v5
- with:
- distribution: 'temurin'
- java-version: 11
- java-package: jdk
-
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v5
-
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
-
- - uses: actions/cache@v5
- with:
- path: |
- ~/.gradle/caches
- key: ${{ runner.os }}-gradle-precommit-${{
hashFiles('versions.lock') }}
- restore-keys: |
- ${{ runner.os }}-gradle-precommit-
- ${{ runner.os }}-gradle-
+ - uses: ./.github/actions/prepare-for-build
- name: Run extraction module tests
run: ./gradlew --no-daemon solr:modules:extraction:check
diff --git a/.github/workflows/gradle-precommit.yml
b/.github/workflows/gradle-precommit.yml
index 88c47be0f5c..ac56df84a17 100644
--- a/.github/workflows/gradle-precommit.yml
+++ b/.github/workflows/gradle-precommit.yml
@@ -3,43 +3,20 @@ name: Gradle Precommit
on:
pull_request:
branches:
- - 'main'
- - 'branch_*'
+ - '*'
jobs:
test:
- name: gradle check w/ Java 11
+ name: gradle check
runs-on: ubuntu-latest
+ timeout-minutes: 15
steps:
- # Setup
- - uses: actions/checkout@v5
+ - name: Checkout code
+ uses: actions/checkout@v5
- - name: Set up JDK 11
- uses: actions/setup-java@v5
- with:
- distribution: 'temurin'
- java-version: 11
- java-package: jdk
-
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v5
-
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
-
- - uses: actions/cache@v5
- with:
- path: |
- ~/.gradle/caches
- key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('versions.lock')
}}
- restore-keys: |
- ${{ runner.os }}-gradle-precommit-
- ${{ runner.os }}-gradle-
+ - uses: ./.github/actions/prepare-for-build
- name: Run gradle check (without tests)
- run: ./gradlew check -x test -Ptask.times=true
-
- - name: Validate Gradle wrapper
- uses: gradle/actions/wrapper-validation@v5
+ run: ./gradlew check -x test -Ptask.times=true --continue
diff --git a/.github/workflows/solrj-test.yml b/.github/workflows/solrj-test.yml
index 60a8f84483d..c81246b41be 100644
--- a/.github/workflows/solrj-test.yml
+++ b/.github/workflows/solrj-test.yml
@@ -3,8 +3,7 @@ name: SolrJ Tests
on:
pull_request:
branches:
- - 'main'
- - 'branch_*'
+ - '*'
paths:
- '.github/workflows/solrj-test.yml'
- 'solr/solrj/**'
@@ -14,27 +13,13 @@ jobs:
name: Run SolrJ Tests
runs-on: ubuntu-latest
+ timeout-minutes: 15
steps:
- # Setup
- - uses: actions/checkout@v5
- - name: Set up JDK 11
- uses: actions/setup-java@v5
- with:
- distribution: 'temurin'
- java-version: 11
- java-package: jdk
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v5
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
- - uses: actions/cache@v5
- with:
- path: |
- ~/.gradle/caches
- key: ${{ runner.os }}-gradle-solrj-${{ hashFiles('versions.lock') }}
- restore-keys: |
- ${{ runner.os }}-gradle-solrj-
- ${{ runner.os }}-gradle-
- - name: Test the SolrJ Package
+ - name: Checkout code
+ uses: actions/checkout@v5
+
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Test SolrJ module
run: ./gradlew solr:solrj:test
diff --git a/.github/workflows/tests-via-crave.yml
b/.github/workflows/tests-via-crave.yml
index f9fbc61c9a3..1476d9c9660 100644
--- a/.github/workflows/tests-via-crave.yml
+++ b/.github/workflows/tests-via-crave.yml
@@ -3,8 +3,7 @@ name: Solr Tests
on:
pull_request:
branches:
- - 'main'
- - 'branch_*'
+ - '*'
jobs:
test:
@@ -26,7 +25,7 @@ jobs:
- name: Initialize, build, test
run: |
cd /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
- crave run --clean
+ crave run --clean --message "PR: ${GITHUB_REF_NAME}" -- ./gradlew
--console=plain test
- name: Cleanup
if: ${{ always() }}
run: |
diff --git a/.github/workflows/validate-changelog.yml
b/.github/workflows/validate-changelog.yml
index 495b23802db..186eec1e3ab 100644
--- a/.github/workflows/validate-changelog.yml
+++ b/.github/workflows/validate-changelog.yml
@@ -28,27 +28,6 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- - name: Check for CHANGES.txt edits
- if: steps.check-label.outputs.skip == 'false'
- run: |
- # Get the list of changed files
- CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref
}}...HEAD)
-
- if echo "$CHANGED_FILES" | grep -q "^solr/CHANGES\.txt$"; then
- echo "::error::Use of solr/CHANGES.txt is deprecated. Please create
a changelog yaml file instead."
- echo ""
- echo "Instead of editing CHANGES.txt, please:"
- echo "1. Run: ./gradlew writeChangelog"
- echo "2. Edit the generated YAML file in changelog/unreleased/"
- echo "3. Commit both the code change and the YAML file"
- echo ""
- echo "For more information, see: dev-docs/changelog.adoc"
- echo ""
- echo "If this PR should not have a changelog entry (e.g.,
documentation-only changes),"
- echo "add the 'no-changelog' label to this PR."
- exit 1
- fi
-
- name: Check for changelog entry
if: steps.check-label.outputs.skip == 'false'
run: |
@@ -106,7 +85,7 @@ jobs:
VALIDATION_FAILED=false
while IFS= read -r file; do
- if [ -z "$file" ]; then
+ if [ -z "$file" ] || [ ! -f "$file" ]; then
continue
fi