File tree Expand file tree Collapse file tree 6 files changed +72
-97
lines changed
actions/prepare-for-build Expand file tree Collapse file tree 6 files changed +72
-97
lines changed Original file line number Diff line number Diff line change
1
+ # This composite action is included in other workflows to have a shared setup
2
+ # for java, gradle, caches, etc.
3
+
4
+ name : Prepare build
5
+ description : Creates a shared setup for other workflows
6
+
7
+ inputs :
8
+ java-version :
9
+ required : false
10
+ default : " 21"
11
+ description : " The default JDK version to set up."
12
+
13
+ java-distribution :
14
+ required : false
15
+ default : " temurin"
16
+ description : " The default JDK distribution type"
17
+
18
+ runs :
19
+ using : " composite"
20
+ steps :
21
+ - name : Set up Java (${{ inputs.java-distribution }}, ${{ inputs.java-version }})"
22
+ uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
23
+ with :
24
+ distribution : ${{ inputs.java-distribution }}
25
+ java-version : ${{ inputs.java-version }}
26
+ java-package : jdk
27
+
28
+ - name : Cache gradle-wrapper.jar
29
+ uses : actions/cache@v4
30
+ with :
31
+ path : gradle/wrapper/gradle-wrapper.jar
32
+ key : gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
33
+
34
+ # This includes "smart" caching of gradle dependencies.
35
+ - name : Set up Gradle
36
+ uses : gradle/actions/setup-gradle@v4
37
+ with :
38
+ # increase expiry time for the temp. develocity token.
39
+ # https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#increasing-the-expiry-time-for-develocity-access-tokens
40
+ develocity-token-expiry : 8
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ name: Solr Script Tests
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' main'
7
- - ' branch_*'
6
+ - ' *'
8
7
paths :
9
8
- ' .github/workflows/bin-solr-test.yml'
10
9
- ' solr/bin/**'
@@ -17,33 +16,20 @@ jobs:
17
16
name : Run Solr Script Tests
18
17
19
18
runs-on : ubuntu-latest
19
+ timeout-minutes : 40
20
20
21
21
env :
22
22
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
23
23
24
24
steps :
25
- # Setup
26
- - uses : actions/checkout@v4
27
- - name : Set up JDK
28
- uses : actions/setup-java@v4
29
- with :
30
- distribution : ' temurin'
31
- java-version : 21
32
- java-package : jdk
33
- - name : Setup Gradle
34
- uses : gradle/actions/setup-gradle@v4
35
- - name : Grant execute permission for gradlew
36
- run : chmod +x gradlew
37
- - uses : actions/cache@v4
38
- with :
39
- path : |
40
- ~/.gradle/caches
41
- key : ${{ runner.os }}-gradle-binsolr-${{ hashFiles('**/*.lockfile') }}
42
- restore-keys : |
43
- ${{ runner.os }}-gradle-binsolr-
44
- ${{ runner.os }}-gradle-
25
+ - name : Checkout code
26
+ uses : actions/checkout@v4
27
+
28
+ - uses : ./.github/actions/prepare-for-build
29
+
45
30
- name : Test the bin/solr script
46
31
run : ./gradlew integrationTests
32
+
47
33
- name : Archive logs
48
34
if : ${{ failure() }}
49
35
uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ name: Docker Build & Test
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' main'
7
- - ' branch_*'
6
+ - ' *'
8
7
paths :
9
8
- ' .github/workflows/docker-test.yml'
10
9
- ' solr/bin/**'
@@ -17,36 +16,21 @@ jobs:
17
16
name : Build and test Docker image
18
17
19
18
runs-on : ubuntu-latest
19
+ timeout-minutes : 15
20
20
21
21
env :
22
22
SOLR_DOCKER_IMAGE_REPO : github-pr/solr
23
23
SOLR_DOCKER_IMAGE_TAG : ${{github.event.number}}
24
24
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
25
25
26
26
steps :
27
- # Setup
28
- - uses : actions/checkout@v4
29
- - name : Set up JDK 21
30
- uses : actions/setup-java@v4
31
- with :
32
- distribution : ' temurin'
33
- java-version : 21
34
- java-package : jdk
35
- - name : Setup Gradle
36
- uses : gradle/actions/setup-gradle@v4
37
- - name : Install ACL
38
- run : sudo apt-get install acl
39
- - name : Grant execute permission for gradlew
40
- run : chmod +x gradlew
41
- - uses : actions/cache@v4
42
- with :
43
- path : |
44
- ~/.gradle/caches
45
- key : ${{ runner.os }}-gradle-docker-${{ hashFiles('**/*.lockfile') }}
46
- restore-keys : |
47
- ${{ runner.os }}-gradle-docker-
48
- ${{ runner.os }}-gradle-
27
+ - name : Checkout code
28
+ uses : actions/checkout@v4
29
+
30
+ - uses : ./.github/actions/prepare-for-build
31
+
49
32
- name : Build Docker image with Gradle
50
33
run : ./gradlew solr:docker:docker
34
+
51
35
- name : Run tests on Docker image
52
36
run : ./gradlew solr:docker:testDocker
Original file line number Diff line number Diff line change @@ -3,45 +3,26 @@ name: Gradle Precommit
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' main'
7
- - ' branch_*'
6
+ - ' *'
8
7
9
8
jobs :
10
9
test :
11
10
name : gradle check
12
11
13
12
runs-on : ubuntu-latest
13
+ timeout-minutes : 15
14
14
15
15
env :
16
16
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
17
17
18
18
steps :
19
- # Setup
20
- - uses : actions/checkout@v4
21
-
22
- - name : Set up JDK
23
- uses : actions/setup-java@v4
24
- with :
25
- distribution : ' temurin'
26
- java-version : 21
27
- java-package : jdk
28
-
29
- - name : Setup Gradle
30
- uses : gradle/actions/setup-gradle@v4
31
-
32
- - name : Grant execute permission for gradlew
33
- run : chmod +x gradlew
34
-
35
- - uses : actions/cache@v4
36
- with :
37
- path : |
38
- ~/.gradle/caches
39
- key : ${{ runner.os }}-gradle-precommit-${{ hashFiles('**/*.lockfile') }}
40
- restore-keys : |
41
- ${{ runner.os }}-gradle-precommit-
42
- ${{ runner.os }}-gradle-
19
+ - name : Checkout code
20
+ uses : actions/checkout@v4
21
+
22
+ - uses : ./.github/actions/prepare-for-build
43
23
44
24
- name : Run gradle check (without tests)
45
25
run : ./gradlew check -x test -Ptask.times=true --continue
46
26
47
- - uses : gradle/wrapper-validation-action@v3
27
+ - name : Validate Gradle wrapper
28
+ uses : gradle/actions/wrapper-validation@v4
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ name: SolrJ Tests
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' main'
7
- - ' branch_*'
6
+ - ' *'
8
7
paths :
9
8
- ' .github/workflows/solrj-test.yml'
10
9
- ' solr/solrj/**'
@@ -14,30 +13,16 @@ jobs:
14
13
name : Run SolrJ Tests
15
14
16
15
runs-on : ubuntu-latest
16
+ timeout-minutes : 15
17
17
18
18
env :
19
19
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
20
20
21
21
steps :
22
- # Setup
23
- - uses : actions/checkout@v4
24
- - name : Set up JDK 21
25
- uses : actions/setup-java@v4
26
- with :
27
- distribution : ' temurin'
28
- java-version : 21
29
- java-package : jdk
30
- - name : Setup Gradle
31
- uses : gradle/actions/setup-gradle@v4
32
- - name : Grant execute permission for gradlew
33
- run : chmod +x gradlew
34
- - uses : actions/cache@v4
35
- with :
36
- path : |
37
- ~/.gradle/caches
38
- key : ${{ runner.os }}-gradle-solrj-${{ hashFiles('**/*.lockfile') }}
39
- restore-keys : |
40
- ${{ runner.os }}-gradle-solrj-
41
- ${{ runner.os }}-gradle-
22
+ - name : Checkout code
23
+ uses : actions/checkout@v4
24
+
25
+ - uses : ./.github/actions/prepare-for-build
26
+
42
27
- name : Test the SolrJ Package
43
28
run : ./gradlew solr:solrj:test
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ name: Solr Tests
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' main'
7
- - ' branch_*'
6
+ - ' *'
8
7
9
8
jobs :
10
9
test :
You can’t perform that action at this time.
0 commit comments