Skip to content

GHA renovation #3396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/actions/prepare-for-build/action.yml
Original file line number Diff line number Diff line change
@@ -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: "21"
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@v4
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
30 changes: 8 additions & 22 deletions .github/workflows/bin-solr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Solr Script Tests
on:
pull_request:
branches:
- 'main'
- 'branch_*'
- '*'
paths:
- '.github/workflows/bin-solr-test.yml'
- 'solr/bin/**'
Expand All @@ -17,33 +16,20 @@ jobs:
name: Run Solr Script Tests

runs-on: ubuntu-latest
timeout-minutes: 40

env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
# Setup
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-binsolr-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-binsolr-
${{ runner.os }}-gradle-
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/prepare-for-build

- name: Test the bin/solr script
run: ./gradlew integrationTests

- name: Archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Docker Build & Test
on:
pull_request:
branches:
- 'main'
- 'branch_*'
- '*'
paths:
- '.github/workflows/docker-test.yml'
- 'solr/bin/**'
Expand All @@ -17,36 +16,21 @@ 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}}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
# Setup
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install ACL
run: sudo apt-get install acl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need this any more? @HoustonPutman is probably better to look

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in passing tests I trust :-) (which they do)

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-docker-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-docker-
${{ runner.os }}-gradle-
- name: Checkout code
uses: actions/checkout@v4

- 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
35 changes: 8 additions & 27 deletions .github/workflows/gradle-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,26 @@ name: Gradle Precommit
on:
pull_request:
branches:
- 'main'
- 'branch_*'
- '*'

jobs:
test:
name: gradle check

runs-on: ubuntu-latest
timeout-minutes: 15

env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
# Setup
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-precommit-
${{ runner.os }}-gradle-
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/prepare-for-build

- name: Run gradle check (without tests)
run: ./gradlew check -x test -Ptask.times=true --continue

- uses: gradle/wrapper-validation-action@v3
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
29 changes: 7 additions & 22 deletions .github/workflows/solrj-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: SolrJ Tests
on:
pull_request:
branches:
- 'main'
- 'branch_*'
- '*'
paths:
- '.github/workflows/solrj-test.yml'
- 'solr/solrj/**'
Expand All @@ -14,30 +13,16 @@ jobs:
name: Run SolrJ Tests

runs-on: ubuntu-latest
timeout-minutes: 15

env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

steps:
# Setup
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-solrj-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-solrj-
${{ runner.os }}-gradle-
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/prepare-for-build

- name: Test the SolrJ Package
run: ./gradlew solr:solrj:test
3 changes: 1 addition & 2 deletions .github/workflows/tests-via-crave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Solr Tests
on:
pull_request:
branches:
- 'main'
- 'branch_*'
- '*'

jobs:
test:
Expand Down
Loading