-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (127 loc) · 4.56 KB
/
playwright-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
142
143
144
145
146
147
148
name: Playwright Tests
on:
push:
branches:
- main
- integration
pull_request:
branches:
- main
- integration
jobs:
test:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout repositories
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: qua-platform/qualibrate-app
path: qualibrate-app
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install core
uses: actions/checkout@v4
with:
repository: qua-platform/qualibrate-core
path: qualibrate-core
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install runner
uses: actions/checkout@v4
with:
repository: qua-platform/qualibrate-runner
path: qualibrate-runner
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install composite
uses: actions/checkout@v4
with:
repository: qua-platform/qualibrate
path: qualibrate-composite
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install config
uses: actions/checkout@v4
with:
repository: qua-platform/qualibrate-config
path: qualibrate-config
token: ${{ secrets.GITHUB_TOKEN }}
# Step 2: Set up Node.js
- name: Use Node.js
id: node-setup
uses: actions/setup-node@v4
with:
node-version: "20.x"
# Step 3: Cache frontend dependencies
- uses: actions/cache@v4
id: frontend-cache-id
with:
path: qualibrate-app/frontend/node_modules
key: npm-${{ hashFiles('qualibrate-app/frontend/**/package-lock.json') }}
restore-keys: npm-
# Step 4: Install frontend dependencies
- name: Install npm dependencies
if: steps.frontend-cache-id.outputs.cache-hit != 'true'
working-directory: qualibrate-app/frontend
run: npm ci
# Step 5: Build the frontend
- name: Build frontend
working-directory: qualibrate-app/frontend
run: npm run build
# Step 6: Set up Python environment
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache-dependency-path: |
qualibrate-composite/poetry.lock
qualibrate-app/backend/poetry.lock
qualibrate-runner/poetry.lock
qualibrate-core/poetry.lock
qualibrate-config/poetry.lock
# Step 7: Copy built frontend to backend
- name: Copy built FE to BE
run: cp -r qualibrate-app/frontend/dist qualibrate-app/backend/qualibrate_static
# Step 8: Install qualibrate packages
- name: Install qualibrate packages
run: |
pip install ./qualibrate-composite ./qualibrate-app/backend ./qualibrate-runner ./qualibrate-core ./qualibrate-config
# Step 9: Checkout calibration scripts repository
- name: Checkout Calibration Scripts
uses: actions/checkout@v4
with:
repository: 'qua-platform/qualibrate-examples'
path: 'qualibrate-examples'
token: ${{ secrets.QUALIBRATION_EXAMPLES_TOKEN }}
# Step 10: Install Playwright test dependencies
- name: Install Playwright Test Dependencies
run: pip install quam xarray
# Step 11: Create directory for user storage
- name: Create directory for user storage
run: mkdir -p data
# Step 12: Create Qualibrate configuration
- name: Create Qualibrate Configuration
run: |
qualibrate config --auto-accept \
--calibration-library-folder $GITHUB_WORKSPACE/qualibrate-examples/calibrations \
--storage-location $GITHUB_WORKSPACE/data
# Step 13: Install Node.js and Playwright dependencies
- name: Install Playwright Dependencies
working-directory: ./qualibrate-app/frontend/tests
run: |
npm install
npx playwright install-deps chromium
npx playwright install chromium
# Step 14: Start Qualibrate Server
- name: Start Qualibrate Server
run: |
nohup qualibrate start > qualibrate-server.log 2>&1 &
for i in {1..15}; do
if curl -s http://localhost:8001/ > /dev/null; then
echo "Server is up and running"
break
fi
echo "Waiting for server to start..."
sleep 2
done
curl -v http://localhost:8001/
# Step 15: Run Playwright tests
- name: Run Playwright Tests
working-directory: ./qualibrate-app/frontend/tests/e2e
run: npx playwright test