forked from epam/ketcher
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (176 loc) · 5.51 KB
/
run-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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Run Playwright Tests
on:
push:
branches:
- master
- 'release/**'
pull_request:
branches:
- master
- 'release/**'
workflow_dispatch:
env:
# Warnings breaks build on CI
# See: https://github.com/orgs/community/discussions/25228#discussioncomment-3246960
CI: false
MODE: standalone
KETCHER_URL: http://127.0.0.1:4002
DOCKER: true
IGNORE_UNSTABLE_TESTS: true
CI_ENVIRONMENT: true
USE_SEPARATE_INDIGO_WASM: true
jobs:
build_ketcher_micro:
runs-on: ubuntu-latest
container: node:18.14-bullseye-slim
env:
ENABLE_POLYMER_EDITOR: false
steps:
- name: Install dependencies
run: apt-get update -y && apt-get install -y git
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Git safe
run: git config --global --add safe.directory '*'
- name: Install NPM dependencies
run: npm ci
- name: Build all packages
run: npm run build:packages && npm run build:example:standalone
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ketcher-dist-micro
path: example/dist
build_ketcher_macro:
runs-on: ubuntu-latest
container: node:18.14-bullseye-slim
env:
ENABLE_POLYMER_EDITOR: true
steps:
- name: Install dependencies
run: apt-get update -y && apt-get install -y git
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Git safe
run: git config --global --add safe.directory '*'
- name: Install NPM dependencies
run: npm ci
- name: Build all packages
run: npm run build:packages && npm run build:example:standalone
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ketcher-dist-macro
path: example/dist
playwright_tests_micro:
timeout-minutes: 120
runs-on: self-hosted
needs: build_ketcher_micro
container: mcr.microsoft.com/playwright:v1.37.0
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install dependencies
run: npm ci
- name: Create folder for dist
run: mkdir -p example/dist
- name: Download compiled ketcher
uses: actions/download-artifact@v3
with:
name: ketcher-dist-micro
path: example/dist/
- name: Create env file
run: |
cat > ketcher-autotests/.env << EOF
DOCKER=true
KETCHER_URL=$KETCHER_URL
MODE=$MODE
IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS
CI_ENVIRONMENT=$CI_ENVIRONMENT
USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM
EOF
- name: Run tests
run: |
ls example/dist/standalone/
cd example/ && nohup npm run serve:standalone &
cd ketcher-autotests/
npm i
npx playwright install chromium
npx playwright test
playwright_tests_macro:
timeout-minutes: 120
runs-on: self-hosted
needs: build_ketcher_macro
container: mcr.microsoft.com/playwright:v1.37.0
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install dependencies
run: npm ci
- name: Create folder for dist
run: mkdir -p example/dist
- name: Download compiled ketcher
uses: actions/download-artifact@v3
with:
name: ketcher-dist-macro
path: example/dist/
- name: Create env file
run: |
cat > ketcher-autotests/.env << EOF
DOCKER=true
KETCHER_URL=$KETCHER_URL
MODE=$MODE
IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS
CI_ENVIRONMENT=$CI_ENVIRONMENT
USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM
EOF
- name: Run tests
run: |
ls example/dist/standalone/
cd example/ && nohup npm run serve:standalone &
cd ketcher-autotests/
npm i
npx playwright install chromium
npx playwright test
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 1
# - uses: actions/setup-node@v3
# with:
# node-version: 18.12.0
# - name: Install dependencies
# run: npm ci
# - name: Build all packages
# run: npm run build:packages && npm run build:example:standalone
# - name: Run example in standalone mode
# run: cd example/ && nohup npm run serve:standalone &
# - name: Create env file
# run: |
# cd ketcher-autotests
# echo "DOCKER=true" > .env
# echo "KETCHER_URL=$KETCHER_URL" >> .env
# echo "MODE=$MODE" >> .env
# echo "IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS" >> .env
# echo "CI_ENVIRONMENT=$CI_ENVIRONMENT" >> .env
# echo "ENABLE_POLYMER_EDITOR=$ENABLE_POLYMER_EDITOR" >> .env
# echo "USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM" >> .env
# - name: Build autotests for docker
# run: cd ketcher-autotests && npm run docker:build
# - name: Run playwright tests in docker
# run: cd ketcher-autotests && npm run docker:test
# - uses: actions/upload-artifact@v3
# # run even if previous steps fails
# if: always()
# with:
# name: playwright-report
# path: ketcher-autotests/playwright-report/
# retention-days: 5