-
Notifications
You must be signed in to change notification settings - Fork 502
141 lines (125 loc) · 3.84 KB
/
integration-tests.yaml
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
name: Integration Tests Workflow
on:
workflow_dispatch: {}
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
- '.github/workflows/**'
branches: [main]
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
branches: [main]
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-ui-tests:
name: Prepare for UI Integration Tests
runs-on: ubuntu-22.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Show Actor
run: echo ${{github.actor}}
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'ui/**/package-lock.json'
- name: Install UI Dependencies
run: |
cd ui
npm install
- name: Lint UI Code
run: |
cd ui
npm run lint
- name: Build and Package UI
run: |
cd ui
npm run build
npm run package
- name: Build and Push UI image
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: |
cd ui
docker build -t $IMAGE_REPO/apicurio/apicurio-studio-ui:$IMAGE_TAG .
docker push $IMAGE_REPO/apicurio/apicurio-studio-ui:$IMAGE_TAG
integration-tests-ui:
name: Integration Tests UI
runs-on: ubuntu-20.04
needs: [prepare-ui-tests]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'ui/tests/package-lock.json'
- name: Run UI tests
run: |
echo "Starting Registry API (In Memory)"
docker run -it -p 8080:8080 --env apicurio.rest.deletion.artifact-version.enabled=true --env apicurio.rest.mutability.artifact-version-content.enabled=true -d quay.io/apicurio/apicurio-registry:latest-snapshot
echo "Starting Studio UI"
docker run -it -p 8888:8080 -d ttl.sh/${{ github.sha }}/apicurio/apicurio-studio-ui:1d
cd ui/tests
npm install
npx playwright install --with-deps
echo "App System Info:"
echo "--"
curl -s http://localhost:8080/apis/registry/v3/system/info
echo "--"
echo ""
echo "UI Config Info (Local):"
echo "--"
curl -s http://localhost:8888/config.js
echo "--"
echo ""
echo "UI Config Info (Remote):"
echo "--"
curl -s http://localhost:8080/apis/registry/v3/system/uiConfig
echo "--"
echo ""
echo "UI Version Info:"
curl -s http://localhost:8888/version.js
echo "--"
echo "UI index.html:"
echo "--"
curl -s http://localhost:8888
echo "--"
echo ""
echo "-------------------------"
echo "Running Playwright tests!"
echo "-------------------------"
npm run test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ui/tests/playwright-report/
retention-days: 30
- name: Collect logs
if: failure()
run: ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: tests-logs-ui
path: artifacts