From 50a783e8091538f359d6a18dfafee9ab2d948803 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Thu, 27 Jul 2023 10:41:53 -0400 Subject: [PATCH] Add Gradle's 'assemble' check to catch the distribution generation issues Signed-off-by: Andriy Redko --- .github/workflows/assemble.yml | 31 +++++++++++++++++++ .github/workflows/precommit.yml | 7 +++-- .../docker/docker-arm64-export/build.gradle | 25 +++++++++++++++ .../docker/docker-s390x-export/build.gradle | 25 +++++++++++++++ 4 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/assemble.yml create mode 100644 distribution/docker/docker-arm64-export/build.gradle create mode 100644 distribution/docker/docker-s390x-export/build.gradle diff --git a/.github/workflows/assemble.yml b/.github/workflows/assemble.yml new file mode 100644 index 0000000000000..fe5201835be49 --- /dev/null +++ b/.github/workflows/assemble.yml @@ -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 == 'macos' + 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 diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 8bbba657737c8..714e196c3a72b 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -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 diff --git a/distribution/docker/docker-arm64-export/build.gradle b/distribution/docker/docker-arm64-export/build.gradle new file mode 100644 index 0000000000000..a5bea2935b3ea --- /dev/null +++ b/distribution/docker/docker-arm64-export/build.gradle @@ -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" } diff --git a/distribution/docker/docker-s390x-export/build.gradle b/distribution/docker/docker-s390x-export/build.gradle new file mode 100644 index 0000000000000..a5bea2935b3ea --- /dev/null +++ b/distribution/docker/docker-s390x-export/build.gradle @@ -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" }