Skip to content

Commit

Permalink
Add Gradle's 'assemble' check to catch the distribution generation is…
Browse files Browse the repository at this point in the history
…sues

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Jul 27, 2023
1 parent c25c175 commit 24ecb13
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Gradle Assemble
on: [pull_request]

jobs:
assemble:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [windows-latest]
steps:
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Check docker (missing on Windows)
if: runner.os == 'windows'
run: |
docker ps
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
# - name: Run Gradle
# run: |
# ./gradlew assemble
7 changes: 4 additions & 3 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ jobs:
matrix:
os: [windows-latest, macos-latest] # precommit on ubuntu-latest is run as a part of the gradle-check workflow
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
distribution: temurin
cache: gradle
- name: Run Gradle
run: |
./gradlew javadoc precommit --parallel
25 changes: 25 additions & 0 deletions distribution/docker/docker-arm64-export/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import org.opensearch.gradle.DockerBase

apply plugin: 'base'

tasks.register("buildDockerBuildContext", Tar) {
archiveExtension = 'tar.gz'
compression = Compression.GZIP
archiveClassifier = "docker-build-context"
archiveBaseName = "opensearch"
// Non-local builds don't need to specify an architecture.
with dockerBuildContext(null, DockerBase.CENTOS, false)
}

tasks.named("assemble").configure { dependsOn "buildDockerBuildContext" }
25 changes: 25 additions & 0 deletions distribution/docker/docker-s390x-export/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import org.opensearch.gradle.DockerBase

apply plugin: 'base'

tasks.register("buildDockerBuildContext", Tar) {
archiveExtension = 'tar.gz'
compression = Compression.GZIP
archiveClassifier = "docker-build-context"
archiveBaseName = "opensearch"
// Non-local builds don't need to specify an architecture.
with dockerBuildContext(null, DockerBase.CENTOS, false)
}

tasks.named("assemble").configure { dependsOn "buildDockerBuildContext" }

0 comments on commit 24ecb13

Please sign in to comment.