From fffa5f61fd0719eeb42d1b4c6d1c67ce76d1bd22 Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Mon, 16 Dec 2024 15:40:23 -0700 Subject: [PATCH] fix: setting up baselines Signed-off-by: Matt Peterson --- .../generate-gradle-artifact-baseline.sh | 1 - .../zxc-verify-gradle-build-determinism.yaml | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/support/scripts/generate-gradle-artifact-baseline.sh b/.github/workflows/support/scripts/generate-gradle-artifact-baseline.sh index f150b96e8..3b4168771 100755 --- a/.github/workflows/support/scripts/generate-gradle-artifact-baseline.sh +++ b/.github/workflows/support/scripts/generate-gradle-artifact-baseline.sh @@ -2,7 +2,6 @@ set -o pipefail set +e -#readonly RELEASE_LIB_PATH="server/build/libs" readonly RELEASE_APPS_PATH="server/build/libs" GROUP_ACTIVE="false" diff --git a/.github/workflows/zxc-verify-gradle-build-determinism.yaml b/.github/workflows/zxc-verify-gradle-build-determinism.yaml index 85fb17963..f50b2c866 100644 --- a/.github/workflows/zxc-verify-gradle-build-determinism.yaml +++ b/.github/workflows/zxc-verify-gradle-build-determinism.yaml @@ -61,6 +61,11 @@ jobs: generate-baseline: name: Generate Baseline runs-on: block-node-linux-medium + outputs: + sha: ${{ steps.commit.outputs.sha }} + path: ${{ steps.baseline.outputs.path }} + file: ${{ steps.baseline.outputs.file }} + name: ${{ steps.baseline.outputs.name }} steps: - name: Harden Runner uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 @@ -87,6 +92,23 @@ jobs: id: commit run: echo "sha=$(git rev-parse HEAD)" >> "${GITHUB_OUTPUT}" + - name: Baseline Existence Check + id: baseline + run: | + BASELINE_NAME="${{ steps.commit.outputs.sha }}.tar.gz" + BASELINE_PATH="gs://hedera-ci-ephemeral-artifacts/${{ github.repository }}/gradle/baselines" + BASELINE_FILE="${BASELINE_PATH}/${BASELINE_NAME}" + BASELINE_EXISTS="false" + + if gsutil ls "${BASELINE_FILE}" >/dev/null 2>&1; then + BASELINE_EXISTS="true" + fi + + echo "exists=${BASELINE_EXISTS}" >> "${GITHUB_OUTPUT}" + echo "path=${BASELINE_PATH}" >> "${GITHUB_OUTPUT}" + echo "name=${BASELINE_NAME}" >> "${GITHUB_OUTPUT}" + echo "file=${BASELINE_FILE}" >> "${GITHUB_OUTPUT}" + - name: Build Artifacts id: gradle-build run: ./gradlew assemble --scan