Skip to content

Commit af5d393

Browse files
committed
fix asdf install
1 parent 5c9109a commit af5d393

File tree

2 files changed

+41
-31
lines changed

2 files changed

+41
-31
lines changed

.github/workflows/run_regression_tests.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,30 @@ jobs:
4040
owner: "NHSDigital"
4141
repositories: "electronic-prescription-service-api-regression-tests"
4242

43+
# using git commit sha for version of action to ensure we have stable version
44+
- name: Get asdf version
45+
id: asdf-version
46+
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
47+
4348
# using git commit sha for version of action to ensure we have stable version
4449
- name: Install asdf
4550
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
4651
with:
47-
asdf_branch: v0.11.3
52+
asdf_version: ${{ steps.asdf-version.outputs.version }}
4853

4954
- name: Cache asdf
5055
uses: actions/cache@v4
5156
with:
5257
path: |
5358
~/.asdf
54-
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
59+
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
5560
restore-keys: |
56-
${{ runner.os }}-asdf-
61+
${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
5762
5863
- name: Install asdf dependencies in .tool-versions
5964
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
6065
with:
61-
asdf_branch: v0.11.3
66+
asdf_version: ${{ steps.asdf-version.outputs.version }}
6267
env:
6368
PYTHON_CONFIGURE_OPTS: --enable-shared
6469

@@ -69,23 +74,23 @@ jobs:
6974
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
7075
GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }}
7176
run: |
72-
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
73-
# this should be the tag of the tests you want to run
74-
REGRESSION_TEST_REPO_TAG=v3.3.1
77+
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
78+
# this should be the tag of the tests you want to run
79+
REGRESSION_TEST_REPO_TAG=v3.3.1
7580
76-
# this should be the tag of the regression test workflow you want to run
77-
# This will normally be the same as REGRESSION_TEST_REPO_TAG
78-
REGRESSION_TEST_WORKFLOW_TAG=v3.3.1
81+
# this should be the tag of the regression test workflow you want to run
82+
# This will normally be the same as REGRESSION_TEST_REPO_TAG
83+
REGRESSION_TEST_WORKFLOW_TAG=v3.3.1
7984
80-
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
81-
poetry install
82-
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
83-
poetry run python -u run_regression_tests.py \
84-
--env="$TARGET_ENVIRONMENT" \
85-
--pr_label="$VERSION_NUMBER" \
86-
--token=${{ steps.generate-token.outputs.token }} \
87-
--is_called_from_github=true \
88-
--product ${{ inputs.REGRESSION_TEST_PRODUCT }} \
89-
--regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \
90-
--regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}"
91-
fi
85+
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
86+
poetry install
87+
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
88+
poetry run python -u run_regression_tests.py \
89+
--env="$TARGET_ENVIRONMENT" \
90+
--pr_label="$VERSION_NUMBER" \
91+
--token=${{ steps.generate-token.outputs.token }} \
92+
--is_called_from_github=true \
93+
--product ${{ inputs.REGRESSION_TEST_PRODUCT }} \
94+
--regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \
95+
--regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}"
96+
fi

.github/workflows/sam_package_code.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,40 @@ jobs:
1616
with:
1717
ref: ${{ env.BRANCH_NAME }}
1818

19+
# using git commit sha for version of action to ensure we have stable version
20+
- name: Get asdf version
21+
id: asdf-version
22+
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
23+
1924
# using git commit sha for version of action to ensure we have stable version
2025
- name: Install asdf
2126
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
2227
with:
23-
asdf_branch: v0.11.3
24-
28+
asdf_version: ${{ steps.asdf-version.outputs.version }}
29+
2530
- name: Cache asdf
2631
uses: actions/cache@v4
2732
with:
2833
path: |
2934
~/.asdf
30-
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
35+
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
3136
restore-keys: |
32-
${{ runner.os }}-asdf-
37+
${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ steps.asdf-version.outputs.version }}
3338
3439
- name: Install asdf dependencies in .tool-versions
3540
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
3641
with:
37-
asdf_branch: v0.11.3
42+
asdf_version: ${{ steps.asdf-version.outputs.version }}
3843
env:
3944
PYTHON_CONFIGURE_OPTS: --enable-shared
40-
45+
4146
- name: Setting up .npmrc
4247
env:
4348
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4449
run: |
4550
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
4651
echo "@NHSDigital:registry=https://npm.pkg.github.com" >> ~/.npmrc
47-
52+
4853
- name: make install
4954
run: |
5055
make install
@@ -67,7 +72,7 @@ jobs:
6772
.aws-sam/build
6873
packages/getSecretLayer/lib/get-secrets-layer.zip
6974
SAMtemplates/state_machines/GetMyPrescriptionsStateMachine.asl.json
70-
75+
7176
- shell: bash
7277
name: package sandbox code
7378
run: |
@@ -77,7 +82,7 @@ jobs:
7782
make sam-build-sandbox
7883
cp Makefile .aws-sam/build/
7984
cp samconfig_package_and_deploy.toml .aws-sam/build/
80-
85+
8186
- uses: actions/upload-artifact@v4
8287
name: upload sandbox build artifact
8388
with:

0 commit comments

Comments
 (0)