generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (57 loc) · 1.92 KB
/
regression-tests.yml
File metadata and controls
64 lines (57 loc) · 1.92 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
name: E2E Regression Tests
on:
workflow_call:
inputs:
ENVIRONMENT:
required: true
type: string
VERSION_NUMBER:
required: true
type: string
secrets: { }
jobs:
regression-tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache asdf
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: |
~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install asdf tools
uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
with:
asdf_branch: v0.15.0
env:
PYTHON_CONFIGURE_OPTS: --enable-shared
- name: Derive Python version from .tool-versions
run: |
PYTHON_VERSION=$(grep "^python" .tool-versions | sed 's/python //g')
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
- name: setup python venv
uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '${{ env.PYTHON_VERSION }}'
cache: 'poetry' # caching poetry dependencies
- run: poetry install
- name: Run Regression Testing
working-directory: scripts
if: ${{ (inputs.ENVIRONMENT != 'prod') && (inputs.ENVIRONMENT != 'ref') }}
env:
TARGET_ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
TESTS_TOKEN: ${{ secrets.REGRESSION_TESTS_PAT }}
run: |
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment.
poetry run python run_regression_tests.py \
--env="$TARGET_ENVIRONMENT" \
--token="$TESTS_TOKEN" \
--regression_test_repo_tag "$VERSION_NUMBER"