-
Notifications
You must be signed in to change notification settings - Fork 60
137 lines (132 loc) · 5.49 KB
/
integration-tests.yml
File metadata and controls
137 lines (132 loc) · 5.49 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
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
name: Integration Tests
on:
schedule:
- cron: '30 1 * * 1-5' # At 01:30 on every day-of-week from Monday through Friday.
workflow_dispatch:
jobs:
ui5-versions:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
ui5_versions: ${{ steps.output-ui5-versions.outputs.ui5_versions }}
steps:
- name: Read UI5 versions from cache
uses: actions/cache/restore@v4
with:
path: |
tests/integration/adaptation-editor/versions.json
key: ui5-versions
restore-keys: ui5-versions-
- name: Output UI5 versions
id: output-ui5-versions
run: |
cat tests/integration/adaptation-editor/versions.json
echo "ui5_versions=$(cat tests/integration/adaptation-editor/versions.json)" >> $GITHUB_OUTPUT
playwright-tests:
# if: github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
ui5-version: ${{ fromJson(needs.ui5-versions.outputs.ui5_versions) }}
runs-on: ubuntu-latest
needs: ui5-versions
timeout-minutes: 30
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ubuntu-latest-build-${{ env.cache-name }}-20.x-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
ubuntu-latest-build-build-${{ env.cache-name }}-20.x-
- name: Use Node.js 20.x
uses: actions/setup-node@v6
with:
node-version: 20.x
- name: Install pnpm modules
run: pnpm install
- name: Run build
run: pnpm run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Cache playwright browsers
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: playwright-browsers-os-ubuntu-latest-node-version-20.x
- name: Install playwright chrome browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install chrome
- name: Read UI5 versions from cache
uses: actions/cache/restore@v4
with:
path: |
tests/integration/adaptation-editor/versions.json
key: ui5-versions-
restore-keys: ui5-versions
- name: Run playwright tests
run: cd tests/integration/adaptation-editor && pnpm exec playwright test --project=${{ matrix.ui5-version }} --reporter=blob
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.ui5-version }}
path: tests/integration/adaptation-editor/blob-report
retention-days: 1
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() }}
needs: [playwright-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ubuntu-latest-build-${{ env.cache-name }}-20.x-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
ubuntu-latest-build-build-${{ env.cache-name }}-20.x-
- name: Use Node.js 20.x
uses: actions/setup-node@v6
with:
node-version: 20.x
- name: Install pnpm modules
run: pnpm install
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: tests/integration/adaptation-editor/all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: cd tests/integration/adaptation-editor && npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ github.run_attempt }}
path: tests/integration/adaptation-editor/playwright-report
retention-days: 15