2525
2626 steps :
2727 - name : Checkout local github actions
28- uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
28+ uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
2929 with :
3030 ref : ${{ env.BRANCH_NAME }}
3131 fetch-depth : 0
4545
4646 # using git commit sha for version of action to ensure we have stable version
4747 - name : Install asdf
48- uses : asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
48+ uses : asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
4949 with :
5050 asdf_version : ${{ steps.asdf-version.outputs.version }}
5151
@@ -54,12 +54,12 @@ jobs:
5454 with :
5555 path : |
5656 ~/.asdf
57- key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
57+ key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
5858 restore-keys : |
59- ${{ runner.os }}-asdf-
59+ ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
6060
6161 - name : Install asdf dependencies in .tool-versions
62- uses : asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
62+ uses : asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
6363 with :
6464 asdf_version : ${{ steps.asdf-version.outputs.version }}
6565 env :
@@ -73,14 +73,28 @@ jobs:
7373 GITHUB-TOKEN : ${{ steps.generate-token.outputs.token }}
7474 run : |
7575 if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
76- # this should be the tag of the tests you want to run
77- REGRESSION_TEST_REPO_TAG= v3.4.26
76+ REGRESSION_TEST_REPO_TAG="v3.5.0" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name
77+ REGRESSION_TEST_WORKFLOW_TAG=" v3.5.0" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG
7878
79- # this should be the tag of the regression test workflow you want to run
80- # This will normally be the same as REGRESSION_TEST_REPO_TAG
81- REGRESSION_TEST_WORKFLOW_TAG=v3.4.26
79+ if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then
80+ echo "Error: One or both tag variables are not set" >&2
81+ exit 1
82+ fi
83+
84+ # HELPER IF STATEMENT - It will automatically determine the correct Git URL to use based on the REGRESSION_TEST_WORKFLOW_TAG value
85+ if [[ "$REGRESSION_TEST_WORKFLOW_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
86+ echo "REGRESSION_TEST_WORKFLOW_TAG is a version tag, using tag link"
87+ curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
88+ else
89+ echo "REGRESSION_TEST_WORKFLOW_TAG doesn't look like a version tag, using branch link"
90+ curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/heads/${REGRESSION_TEST_REPO_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
91+ fi
92+
93+ if [[ ! -f run_regression_tests.py ]]; then
94+ echo "Error: run_regression_tests.py not found" >&2
95+ exit 1
96+ fi
8297
83- curl https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py -o run_regression_tests.py
8498 poetry install
8599 echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
86100 poetry run python -u run_regression_tests.py \
0 commit comments