-
Notifications
You must be signed in to change notification settings - Fork 60
98 lines (84 loc) · 3.29 KB
/
e2e_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
name: E2E Tests
on:
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run-e2e:
name: Run E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: datalens-tech/datalens-ui
path: ./datalens-ui
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Get last version config
run: |
VERSION_CONFIG=$(cat ./versions-config.json)
UI_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.uiVersion')
US_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.usVersion')
CONTROL_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.controlApiVersion')
DATA_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.dataApiVersion')
echo "UI_VERSION=$UI_VERSION" >> "$GITHUB_ENV"
echo "US_VERSION=$US_VERSION" >> "$GITHUB_ENV"
echo "CONTROL_API_VERSION=$CONTROL_API_VERSION" >> "$GITHUB_ENV"
echo "DATA_API_VERSION=$DATA_API_VERSION" >> "$GITHUB_ENV"
- name: Check docker compose Config
working-directory: ./datalens-ui
run: npm run test:e2e:docker:check
env:
US_VERSION: ${{ env.US_VERSION }}
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }}
DATA_API_VERSION: ${{ env.DATA_API_VERSION }}
UI_VERSION: ${{ env.UI_VERSION }}
- name: Run tests from builded docker image
if: ${{ env.UI_VERSION != '' }}
working-directory: ./datalens-ui
run: |
cp ../docker-compose.e2e.yml ./tests/docker-compose.e2e.yml
npm run test:e2e:docker
env:
US_VERSION: ${{ env.US_VERSION }}
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }}
DATA_API_VERSION: ${{ env.DATA_API_VERSION }}
UI_VERSION: ${{ env.UI_VERSION }}
- name: Copy tests report from docker run
if: always()
working-directory: ./datalens-ui
run: |
echo "export report from docker run"
rm -rf ./tests/artifacts
npm run test:e2e:docker:report
env:
US_VERSION: ${{ env.US_VERSION }}
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }}
DATA_API_VERSION: ${{ env.DATA_API_VERSION }}
UI_VERSION: ${{ env.UI_VERSION }}
- name: Run docker compose down
if: always()
working-directory: ./datalens-ui
run: |
npm run test:e2e:docker:down
env:
US_VERSION: ${{ env.US_VERSION }}
CONTROL_API_VERSION: ${{ env.CONTROL_API_VERSION }}
DATA_API_VERSION: ${{ env.DATA_API_VERSION }}
UI_VERSION: ${{ env.UI_VERSION }}
- name: Save report link and pr number
if: always()
working-directory: ./datalens-ui
run: |
mkdir -p ./tests/artifacts
echo "reports/${{ github.head_ref || github.ref_name }}/${{ github.run_id }}/${{ github.run_attempt }}" > ./tests/artifacts/report-link
echo "${{ github.event.pull_request.number }}" > ./tests/artifacts/report-pr
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./datalens-ui/tests/artifacts/
retention-days: 30