Skip to content

Commit 55d725b

Browse files
committed
Add Gradle's 'assemble' check to catch the distribution generation issues
Signed-off-by: Andriy Redko <[email protected]>
1 parent c25c175 commit 55d725b

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed

.github/workflows/assemble.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Gradle Assemble
2+
on: [pull_request]
3+
4+
jobs:
5+
assemble:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
matrix:
9+
# os: [ubuntu-latest, windows-latest, macos-latest]
10+
os: [windows-2019]
11+
steps:
12+
- name: Setup docker (missing on MacOS)
13+
if: runner.os == 'macos'
14+
run: |
15+
brew install docker
16+
colima start
17+
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
18+
- uses: actions/checkout@v3
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: 11
23+
distribution: temurin
24+
cache: gradle
25+
- name: Run Gradle
26+
run: |
27+
./gradlew assemble

.github/workflows/precommit.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ jobs:
88
matrix:
99
os: [windows-latest, macos-latest] # precommit on ubuntu-latest is run as a part of the gradle-check workflow
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- name: Set up JDK 11
13-
uses: actions/setup-java@v2
13+
uses: actions/setup-java@v3
1414
with:
1515
java-version: 11
16-
distribution: adopt
16+
distribution: temurin
17+
cache: gradle
1718
- name: Run Gradle
1819
run: |
1920
./gradlew javadoc precommit --parallel
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*
8+
* Modifications Copyright OpenSearch Contributors. See
9+
* GitHub history for details.
10+
*/
11+
12+
import org.opensearch.gradle.DockerBase
13+
14+
apply plugin: 'base'
15+
16+
tasks.register("buildDockerBuildContext", Tar) {
17+
archiveExtension = 'tar.gz'
18+
compression = Compression.GZIP
19+
archiveClassifier = "docker-build-context"
20+
archiveBaseName = "opensearch"
21+
// Non-local builds don't need to specify an architecture.
22+
with dockerBuildContext(null, DockerBase.CENTOS, false)
23+
}
24+
25+
tasks.named("assemble").configure { dependsOn "buildDockerBuildContext" }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*
8+
* Modifications Copyright OpenSearch Contributors. See
9+
* GitHub history for details.
10+
*/
11+
12+
import org.opensearch.gradle.DockerBase
13+
14+
apply plugin: 'base'
15+
16+
tasks.register("buildDockerBuildContext", Tar) {
17+
archiveExtension = 'tar.gz'
18+
compression = Compression.GZIP
19+
archiveClassifier = "docker-build-context"
20+
archiveBaseName = "opensearch"
21+
// Non-local builds don't need to specify an architecture.
22+
with dockerBuildContext(null, DockerBase.CENTOS, false)
23+
}
24+
25+
tasks.named("assemble").configure { dependsOn "buildDockerBuildContext" }

0 commit comments

Comments
 (0)