-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (73 loc) · 2.77 KB
/
run_regression_tests.yml
File metadata and controls
80 lines (73 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Run Regression Tests
on:
workflow_call:
inputs:
ENVIRONMENT:
required: true
type: string
VERSION_NUMBER:
required: true
type: string
REGRESSION_TESTS_PEM:
type: string
pinned_image:
type: string
required: true
secrets:
REGRESSION_TESTS_PEM:
required: true
permissions: {}
jobs:
run_regression_tests:
runs-on: ubuntu-22.04
container:
image: ${{ inputs.pinned_image }}
options: --user 1001:1001 --group-add 128
defaults:
run:
shell: bash
permissions:
id-token: write
contents: write
steps:
- name: copy .tool-versions
run: |
cp /home/vscode/.tool-versions "$HOME/.tool-versions"
- name: Checkout local github actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
fetch-depth: 0
- name: Generate a token to authenticate regression testing
id: generate-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3
with:
app-id: ${{ vars.REGRESSION_TESTS_APP_ID }}
private-key: ${{ secrets.REGRESSION_TESTS_PEM }}
owner: "NHSDigital"
repositories: "electronic-prescription-service-api-regression-tests"
- name: Run Regression Testing
working-directory: scripts
env:
TARGET_ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
# this should be the tag of the tests you want to run
REGRESSION_TEST_REPO_TAG=v3.12.36
# this should be the tag of the regression test workflow you want to run
# This will normally be the same as REGRESSION_TEST_REPO_TAG
REGRESSION_TEST_WORKFLOW_TAG=v3.12.36
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
poetry install
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
poetry run python -u run_regression_tests.py \
--env="$TARGET_ENVIRONMENT" \
--pr_label="$VERSION_NUMBER" \
--token=${{ steps.generate-token.outputs.token }} \
--is_called_from_github=true \
--product=PSU \
--regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \
--regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}"
fi