From 7d0ff9016bde1af1119b46b47cc098e226f5b4b8 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 20 Nov 2024 16:22:41 -0300 Subject: [PATCH] add `check_no_git_refs_in_cargo_lock` to CI --- .github/workflows/sub-ci-unit-tests-docker.yml | 9 +++++++++ docker/entrypoint.sh | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub-ci-unit-tests-docker.yml b/.github/workflows/sub-ci-unit-tests-docker.yml index 3f80d24ebbd..eb8781102e8 100644 --- a/.github/workflows/sub-ci-unit-tests-docker.yml +++ b/.github/workflows/sub-ci-unit-tests-docker.yml @@ -197,3 +197,12 @@ jobs: # If there is already an open issue with this label, any failures become comments on that issue. always-create-new-issue: false github-token: ${{ secrets.GITHUB_TOKEN }} + + run-check-no-git-refs: + if: contains(github.event.pull_request.labels.*.name, 'A-release') + runs-on: ubuntu-latest + steps: + - name: Run check_no_git_refs_in_cargo_lock + run: | + docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} + docker run --tty -e NETWORK -e RUN_CHECK_NO_GIT_REFS=1 ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d71be57805d..6f2e49c5613 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -225,12 +225,16 @@ case "$1" in if [[ "${RUN_ALL_TESTS}" -eq "1" ]]; then # Run unit, basic acceptance tests, and ignored tests, only showing command output if the test fails. # If the lightwalletd environmental variables are set, we will also run those tests. - exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored --exclude check_no_git_refs_in_cargo_lock elif [[ "${RUN_ALL_EXPERIMENTAL_TESTS}" -eq "1" ]]; then # Run unit, basic acceptance tests, and ignored tests with experimental features. # If the lightwalletd environmental variables are set, we will also run those tests. - exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored --exclude check_no_git_refs_in_cargo_lock + + elif [[ "${RUN_CHECK_NO_GIT_REFS}" -eq "1" ]]; then + # Run the check_no_git_refs_in_cargo_lock test. + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored check_no_git_refs_in_cargo_lock elif [[ "${TEST_FAKE_ACTIVATION_HEIGHTS}" -eq "1" ]]; then # Run state tests with fake activation heights.