-
Notifications
You must be signed in to change notification settings - Fork 3
152 lines (145 loc) · 5.57 KB
/
just-run-tests.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Just Run Tests
on:
workflow_dispatch:
inputs:
dev:
required: false
default: false
type: boolean
test:
required: false
default: false
type: boolean
uat:
required: false
default: false
type: boolean
run_performance_tests:
required: false
default: false
type: boolean
description: Run performance tests
run_e2e_tests_application:
required: false
default: true
type: boolean
description: Run e2e tests (application)
run_e2e_tests_assessment:
required: false
default: true
type: boolean
description: Run e2e tests (assessment)
run_python_e2e_tests:
required: false
default: true
type: boolean
description: Whether to run the python e2e tests
run_e2e_tests_python:
required: false
default: true
type: boolean
description: Whether to run the python e2e tests
python_e2e_copilot_environment:
description: "Copilot environment to run tests on"
type: choice
options:
- dev
- test
default: dev
jobs:
run_shared_tests_dev:
if: ${{ always() && inputs.dev == true }}
uses: ./.github/workflows/run-shared-tests.yml
with:
run_performance_tests: ${{inputs.run_performance_tests}}
run_e2e_tests_application: ${{inputs.run_e2e_tests_application}}
run_e2e_tests_assessment: ${{inputs.run_e2e_tests_assessment}}
run_e2e_tests_python: ${{inputs.run_e2e_tests_python}}
env_name: dev
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
FS_BASIC_AUTH_USERNAME: ${{ secrets.FS_BASIC_AUTH_USERNAME }}
FS_BASIC_AUTH_PASSWORD: ${{ secrets.FS_BASIC_AUTH_PASSWORD }}
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
run_shared_tests_test:
if: ${{ always() && inputs.test == true }}
uses: ./.github/workflows/run-shared-tests.yml
with:
run_performance_tests: ${{inputs.run_performance_tests}}
run_e2e_tests_application: ${{inputs.run_e2e_tests_application}}
run_e2e_tests_assessment: ${{inputs.run_e2e_tests_assessment}}
run_e2e_tests_python: ${{inputs.run_e2e_tests_python}}
env_name: test
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
FS_BASIC_AUTH_USERNAME: ${{ secrets.FS_BASIC_AUTH_USERNAME }}
FS_BASIC_AUTH_PASSWORD: ${{ secrets.FS_BASIC_AUTH_PASSWORD }}
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
run_shared_tests_uat:
if: ${{ always() && inputs.uat == true }}
uses: ./.github/workflows/run-shared-tests.yml
with:
run_performance_tests: ${{inputs.run_performance_tests}}
run_e2e_tests_application: ${{inputs.run_e2e_tests_application}}
run_e2e_tests_assessment: ${{inputs.run_e2e_tests_assessment}}
run_e2e_tests_python: ${{inputs.run_e2e_tests_python}}
env_name: uat
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
FS_BASIC_AUTH_USERNAME: ${{ secrets.FS_BASIC_AUTH_USERNAME }}
FS_BASIC_AUTH_PASSWORD: ${{ secrets.FS_BASIC_AUTH_PASSWORD }}
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
run_python_tests:
if: ${{ always() && inputs.run_python_e2e_tests == true }}
name: python e2e tests
permissions:
contents: read # This is required for actions/checkout
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
environment: ${{ inputs.python_e2e_copilot_environment }}
steps:
- name: Get current date
shell: bash
id: currentdatetime
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/GithubCopilotDeploy
role-session-name: "python_e2e_${{ inputs.python_e2e_copilot_environment }}_copilot_${{ steps.currentdatetime.outputs.datetime }}"
aws-region: eu-west-2
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1.6.4
with:
app-id: ${{ secrets.FSD_GH_APP_ID }}
private-key: ${{ secrets.FSD_GH_APP_KEY }}
owner: ${{ github.repository_owner }}
repositories: "funding-service-design-e2e-checks"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Checkout E2E tests
uses: actions/checkout@v4.1.1
with:
repository: communitiesuk/funding-service-design-e2e-checks
token: ${{ steps.generate_token.outputs.token }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3
with:
enable-cache: true
- name: Install playwright browsers
# working-directory: funding-service-design-e2e-checks
run: uv run --frozen playwright install --with-deps chromium
- name: Run tests
# working-directory: funding-service-design-e2e-checks
run: uv run --frozen pytest --e2e-env ${{ inputs.python_e2e_copilot_environment }} --tracing=retain-on-failure --browser chromium
env:
E2E_DEVTEST_BASIC_AUTH_USERNAME: ${{ secrets.E2E_DEVTEST_BASIC_AUTH_USERNAME }}
E2E_DEVTEST_BASIC_AUTH_PASSWORD: ${{ secrets.E2E_DEVTEST_BASIC_AUTH_USERNAME }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: test-results/