-
-
Notifications
You must be signed in to change notification settings - Fork 127
74 lines (60 loc) · 1.83 KB
/
library_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
name: Library Test
run-name: Library Test
on:
workflow_run:
workflows: [Integration Test]
types: [completed]
branches:
- main
workflow_dispatch:
jobs:
library-test:
name: Run Library Test
runs-on: ubuntu-latest
strategy:
matrix:
react-version: [16.14.0, 17.0.2, 18.3.1]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21.7.3'
- name: Install Dependencies
run: npm ci
- name: Pack Library
run: npm pack
- name: Create Test Project
run: |
npx create-vite@latest test-project --template react-ts
- name: Copy Template File
run: |
cp ./cypress/fixtures/templates/ChatBotApp.tsx ./test-project/src/App.tsx
if [[ "${{ matrix.react-version }}" =~ ^18 ]]; then
cp ./src/devIndex.tsx ./test-project/src/main.tsx
else
cp ./cypress/fixtures/templates/pre_react_18/index.tsx ./test-project/src/main.tsx
fi
- name: Install Dependencies in Test Project
run: |
cd ./test-project
npm install
npm install -g vite
- name: Install Specific React Version in Test Project
run: |
cd ./test-project
npm uninstall react react-dom
npm install react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}
- name: Install React ChatBotify (.tgz) into Test Project
run: |
cd ./test-project
npm install ../*.tgz
- name: Start App
run: |
cd ./test-project
vite --port 3000 &
- name: Run Library Tests
run: |
npm run cy:run