generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 7
110 lines (95 loc) · 3.67 KB
/
e2e.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
name: ⚙️ E2E tests
on:
pull_request:
env:
PW_RESULT: ./projects/demo-playwright/tests-results
jobs:
e2e:
name: E2E
runs-on: ubuntu-latest
outputs:
details_url: ${{ steps.e2e-report.outputs.details_url }}
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx nx prerender editor-demo -c development
- uses: taiga-family/ci/actions/run/[email protected]
with:
port: ${{ env.NG_SERVER_PORT }}
directory: ${{ env.DIST }}
- run: npx nx e2e editor-demo-playwright -- --update-snapshots
- uses: taiga-family/ci/actions/run/[email protected]
with:
branch: snapshots/demo/next/${{ github.base_ref }}
destination: ${{ env.DIST_NEXT }}
- uses: taiga-family/ci/actions/run/[email protected]
with:
port: ${{ env.NG_SERVER_PORT }}
directory: ${{ env.DIST_NEXT }}
- run: npx nx e2e editor-demo-playwright
continue-on-error: true
- run: tree ${{ env.PW_RESULT }}
- name: Deploy e2e report
id: e2e-report
uses: FirebaseExtended/[email protected]
continue-on-error: true
with:
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TUI_EDITOR }}
repoToken: ${{ secrets.GITHUB_TOKEN }}
target: taiga-editor-e2e-report
projectId: taiga-editor
disableComment: 'true'
expires: 1d
- name: Upload report artifacts
uses: actions/[email protected]
with:
path: ${{ env.PW_RESULT }}/test-results.json
name: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_report
compression-level: 0
retention-days: 1
- name: Upload artifacts / ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}
uses: actions/[email protected]
with:
path: ${{ env.PW_RESULT }}/**/*-retry2/*-diff.png
name: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}
if-no-files-found: ignore
compression-level: 0
retention-days: 1
result:
name: E2E result
needs: [e2e]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Download artifacts for Playwright
continue-on-error: true
uses: actions/[email protected]
with:
path: ${{ env.PW_RESULT }}
name: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}
merge-multiple: true
- uses: actions/[email protected]
with:
path: ${{ env.PW_RESULT }}
name: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_report
- run: tree ${{ env.PW_RESULT }} || echo "not found"
- name: Check if diff-output exists
id: diff_checker
run: |
echo "diff_exist=$(find ${{ env.PW_RESULT }} -path '*retry2/*' -iname '*-diff.png' | wc -l | sed -e 's/^[[:space:]]*//')" >> $GITHUB_OUTPUT
- name: Fall with an error if diff-output exists
if: ${{ steps.diff_checker.outputs.diff_exist != '0' }}
run: |
find ${{ env.PW_RESULT }} -path '*retry2/*' -iname '*-diff.png' -exec echo "{}" \;
exit 1
- uses: daun/[email protected]
if: always()
with:
custom-info: 'For more information, [see our report](${{ needs.e2e.outputs.details_url }})'
report-file: ${{ env.PW_RESULT }}/test-results.json
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true