From 427f0448e88e5547af703c84b5087670a408f2e4 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Fri, 3 Nov 2023 13:19:29 +0100 Subject: [PATCH] Removed dependency on the branch name --- .github/workflows/measurements.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/measurements.yml b/.github/workflows/measurements.yml index 02cdf9c971c..d76d43b19d2 100644 --- a/.github/workflows/measurements.yml +++ b/.github/workflows/measurements.yml @@ -33,24 +33,23 @@ jobs: - name: Measure Contract Sizes env: - PR_BRANCH: ${{ github.head_ref }} PR_NUMBER: ${{ github.event.number }} run: | # Variables MEASUREMENTS_DIR="${GITHUB_WORKSPACE}/../ink-ci-measurements" SCRIPTS_DIR="${GITHUB_WORKSPACE}/scripts" ARTIFACTS_DIR="${GITHUB_WORKSPACE}/artifacts" - PR_BRANCH_CONTRACT_SIZES="${MEASUREMENTS_DIR}/${PR_BRANCH}_contract_sizes" + PR_CONTRACT_SIZES="${MEASUREMENTS_DIR}/pull_request_contract_sizes" UPSTREAM_BRANCH="master" UPSTREAM_CONTRACT_SIZES="${MEASUREMENTS_DIR}/${UPSTREAM_BRANCH}_contract_sizes" UPSTREAM_REPO="https://github.com/smiasojed/ink.git" UPSTREAM_DIR="${MEASUREMENTS_DIR}/ink-${UPSTREAM_BRANCH}" - CONTRACT_SIZES_DIFF="${MEASUREMENTS_DIR}/${PR_BRANCH}_contract_sizes_diff.md" + CONTRACT_SIZES_DIFF="${MEASUREMENTS_DIR}/contract_sizes_diff.md" # Measure contract sizes for the current branch mkdir ${MEASUREMENTS_DIR} - ${SCRIPTS_DIR}/for_all_contracts_exec.sh --path integration-tests --quiet -- ${SCRIPTS_DIR}/contract_size.sh {} > ${PR_BRANCH_CONTRACT_SIZES} - sed -ie 's/^integration-tests\///g' ${PR_BRANCH_CONTRACT_SIZES} + ${SCRIPTS_DIR}/for_all_contracts_exec.sh --path integration-tests --quiet -- ${SCRIPTS_DIR}/contract_size.sh {} > ${PR_CONTRACT_SIZES} + sed -ie 's/^integration-tests\///g' ${PR_CONTRACT_SIZES} # Measure contract sizes for the upstream branch git clone --verbose --depth 1 --branch ${UPSTREAM_BRANCH} ${UPSTREAM_REPO} ${UPSTREAM_DIR} pushd ${UPSTREAM_DIR} @@ -59,12 +58,12 @@ jobs: popd # Build the comparison table - ${SCRIPTS_DIR}/contract_sizes_diff.sh ${UPSTREAM_CONTRACT_SIZES} ${PR_BRANCH_CONTRACT_SIZES} > ${CONTRACT_SIZES_DIFF} + ${SCRIPTS_DIR}/contract_sizes_diff.sh ${UPSTREAM_CONTRACT_SIZES} ${PR_CONTRACT_SIZES} > ${CONTRACT_SIZES_DIFF} cat ${CONTRACT_SIZES_DIFF} # Create job artifact mkdir ${ARTIFACTS_DIR} - mv ${CONTRACT_SIZES_DIFF} ${ARTIFACTS_DIR}/contract_sizes_diff.md + mv ${CONTRACT_SIZES_DIFF} ${ARTIFACTS_DIR}/ CARGO_CONTRACT_VERSION=$(cargo-contract --version | egrep --only-matching "cargo-contract.* .*-x86" | sed -s 's/-x86//') echo "CARGO_CONTRACT_VERSION=\"${CARGO_CONTRACT_VERSION}\"" > ${ARTIFACTS_DIR}/context.out echo "PR_NUMBER=\"${PR_NUMBER}\"" >> ${ARTIFACTS_DIR}/context.out