Delete unpublished RHEL images before publishing [DI-401][5.4.1] #935
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PR | |
on: | |
workflow_dispatch: | |
pull_request: | |
env: | |
test_container_name_oss: hazelcast-oss-test | |
test_container_name_ee: hazelcast-ee-test | |
docker_log_file_oss: docker-hazelcast-oss-test.log | |
docker_log_file_ee: docker-hazelcast-ee-test.log | |
jobs: | |
build-pr: | |
runs-on: ubuntu-latest | |
name: Build with default JDK | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Forbid .github/release_type file | |
run: | | |
if [ -f ".github/release_type" ]; then | |
echo "Error: .github/release_type file is not allowed in the PRs. It's used only during release creation" | |
exit 1 | |
fi | |
- name: Install xmllint | |
uses: ./.github/actions/install-xmllint | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: 'us-east-1' | |
- name: Test scripts | |
run: | | |
.github/scripts/test_scripts.sh | |
- name: Get OSS dist ZIP URL | |
run: | | |
. .github/scripts/oss-build.functions.sh | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' hazelcast-oss/Dockerfile) | |
echo "HAZELCAST_OSS_ZIP_URL=$(get_hz_dist_zip "" ${HZ_VERSION})" >> $GITHUB_ENV | |
- name: Build OSS image | |
run: | | |
DOCKER_PATH=hazelcast-oss | |
# Extract from Dockerfile to avoid duplicate hardcoding of the latest SNAPSHOT version | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' ${DOCKER_PATH}/Dockerfile) | |
docker buildx build --load \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_OSS_ZIP_URL \ | |
--tag hazelcast-oss:test \ | |
${DOCKER_PATH} | |
- name: Run smoke test against OSS image | |
timeout-minutes: 2 | |
run: | | |
.github/scripts/simple-smoke-test.sh hazelcast-oss:test ${{ env.test_container_name_oss }} oss | |
- name: Get EE dist ZIP URL | |
run: | | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' hazelcast-enterprise/Dockerfile) | |
. .github/scripts/ee-build.functions.sh | |
echo "HAZELCAST_EE_ZIP_URL=$(get_hz_dist_zip "" ${HZ_VERSION})" >> $GITHUB_ENV | |
- name: Build Test EE image | |
run: | | |
DOCKER_PATH=hazelcast-enterprise | |
# Extract from Dockerfile to avoid duplicate hardcoding of the latest SNAPSHOT version | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' ${DOCKER_PATH}/Dockerfile) | |
docker buildx build --load \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_EE_ZIP_URL \ | |
--tag hazelcast-ee:test \ | |
${DOCKER_PATH} | |
- name: Run smoke test against EE image | |
timeout-minutes: 2 | |
run: | | |
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }} | |
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }} ee | |
- name: Get docker logs | |
if: ${{ always() }} | |
run: | | |
docker logs ${{ env.test_container_name_oss }} > ${{ env.docker_log_file_oss }} | |
docker logs ${{ env.test_container_name_ee }} > ${{ env.docker_log_file_ee }} | |
- name: Store docker logs as artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-logs | |
path: | | |
${{ env.docker_log_file_oss }} | |
${{ env.docker_log_file_ee }} | |
jdks: | |
uses: ./.github/workflows/get-supported-jdks.yaml | |
build-pr-custom-jdk: | |
runs-on: ubuntu-latest | |
needs: jdks | |
name: Build with jdk-${{ matrix.jdk }} | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install xmllint | |
uses: ./.github/actions/install-xmllint | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: 'us-east-1' | |
- name: Build OSS image | |
run: | | |
DOCKER_PATH=hazelcast-oss | |
# Extract from Dockerfile to avoid duplicate hardcoding of the latest SNAPSHOT version | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' ${DOCKER_PATH}/Dockerfile) | |
docker buildx build --load \ | |
--build-arg JDK_VERSION=${{ matrix.jdk }} \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_OSS_ZIP_URL \ | |
--tag hazelcast-oss:test \ | |
${DOCKER_PATH} | |
- name: Run smoke test against OSS image | |
timeout-minutes: 2 | |
run: | | |
.github/scripts/simple-smoke-test.sh hazelcast-oss:test ${{ env.test_container_name_oss }} oss | |
- name: Build Test EE image | |
run: | | |
DOCKER_PATH=hazelcast-enterprise | |
# Extract from Dockerfile to avoid duplicate hardcoding of the latest SNAPSHOT version | |
HZ_VERSION=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' ${DOCKER_PATH}/Dockerfile) | |
docker buildx build --load \ | |
--build-arg JDK_VERSION=${{ matrix.jdk }} \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_EE_ZIP_URL \ | |
--tag hazelcast-ee:test \ | |
${DOCKER_PATH} | |
- name: Run smoke test against EE image | |
timeout-minutes: 2 | |
run: | | |
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }} | |
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }} ee | |
- name: Get docker logs | |
if: ${{ always() }} | |
run: | | |
docker logs ${{ env.test_container_name_oss }} > ${{ env.docker_log_file_oss }} | |
docker logs ${{ env.test_container_name_ee }} > ${{ env.docker_log_file_ee }} | |
- name: Store docker logs as artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-logs-jdk${{ matrix.jdk }} | |
path: | | |
${{ env.docker_log_file_oss }} | |
${{ env.docker_log_file_ee }} | |