forked from fangci221/library
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (60 loc) · 1.97 KB
/
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
name: 'Node.js CI and Playwright Tests'
on:
workflow_dispatch:
schedule:
# Test 3 times a day
- cron: '0 */8 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: ['14.21.3']
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Start MySQL service
run: |
sudo systemctl start mysql.service
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies of back-end and start building and running
working-directory: source/back-end
run: |
npm install
npm run start &
- name: Install dependencies of front-end and start building and running
working-directory: source/front-end
run: |
npm install
npm run serve &
- name: Ensure browsers are installed
run: playwright install --with-deps
# # Run the registration test first
# - name: Run the registration test
# run: pytest source/test/system-test/test_register.py
- name: Run MySQL database tests first
run: |
pytest source/test/test_import_sql.py source/test/test_mysql_login.py
- name: Run all tests
# run: pytest source/test/system-test/*.py
run: |
pytest --tracing on
- name: Upload trace files as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-trace
path: test-results/