-
-
Notifications
You must be signed in to change notification settings - Fork 19
108 lines (90 loc) · 3.34 KB
/
opa5-test.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
name: opa5 tests
on:
pull_request:
branches:
- main
jobs:
test-opa5:
runs-on: ubuntu-latest
if: "github.event.pull_request.title != 'chore: release main'"
strategy:
fail-fast: false
matrix:
scenario: ["ordersv4fe"]
ui5version: [108, 96, 84, 71]
exclude:
- scenario: ordersv4fe
ui5version: 71
steps:
# - name: update chrome
# run: |
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# sudo apt-get update
# sudo apt-get --only-upgrade install google-chrome-stable
# # check chrome version
# google-chrome --version
- name: install gnome-keyring
run: sudo apt install gnome-keyring
- name: checkout Spreadsheet Upload Repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- run: corepack enable pnpm
- name: use node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: get port
run: |
TESTAPPPORT=$(node ./dev/get-port.js ${{ matrix.scenario }} ${{ matrix.ui5version }})
echo "TESTAPPPORT=$TESTAPPPORT" >> $GITHUB_ENV
- name: pnpm install
run: |
npm pkg delete scripts.prepare
pnpm install --no-frozen-lockfile
- name: copy test apps
run: npm run copyTestApps
- name: install @sap/cds-dk
run: |
npm i -g @sap/cds-dk
- name: install ui5-test-runner
run: |
npm i -g ui5-test-runner
- name: pnpm install
run: |
npm pkg delete scripts.prepare
pnpm install --no-frozen-lockfile
- name: Run Build
run: npm run build
- name: Remove cds-plugin-ui5
run: |
cd examples/packages/server
node -e "const pkg = require('./package.json'); \
delete pkg.cds['cds-plugin-ui5']; \
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));"
# run app
- name: start cap server
run: |
npm run start:server&
- name: start app ${{ matrix.scenario }} ui5 ${{ matrix.ui5version }}
run: |
pnpm --filter ${{ matrix.scenario }}${{ matrix.ui5version }} start:silent&
# run opa5 tests
- name: test opa5 ${{ matrix.scenario }} ui5 ${{ matrix.ui5version }}
id: opa5test # An ID for the step to refer to its outputs later
continue-on-error: true # The job will not stop if this step fails
run: |
while ! nc -z localhost 4004; do sleep 0.1; done
while ! nc -z localhost ${{ env.TESTAPPPORT }}; do sleep 0.1; done
ui5-test-runner --url http://localhost:${{ env.TESTAPPPORT }}/test/integration/opaTests.qunit.html --screenshot false
- name: upload artifact of report folder
uses: actions/upload-artifact@v3
with:
name: ui5testrunner-report-${{ matrix.scenario }}-${{ matrix.ui5version }}
path: ./report
# Fail the job if the 'test opa5' step failed
- name: Check test status
if: steps.opa5test.outcome != 'success'
run: exit 1