forked from hect0x7/JMComic-Crawler-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.63 KB
/
Copy pathtest.yml
File metadata and controls
57 lines (48 loc) · 1.63 KB
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
name: 跑测试
on:
workflow_dispatch:
push:
branches: [ "dev" ]
paths-ignore:
- 'src/**/__init__.py'
- '.github/workflows/*'
- 'usage/workflow_download.py'
- 'assets/config/option_workflow_download.yml'
- 'assets/docs/*'
jobs:
test: # This code is based on https://github.com/gaogaotiantian/viztracer/blob/master/.github/workflows/python-package.yml
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: matrix.os != 'windows-latest'
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
python -m pip install --upgrade pip
if (Test-Path -Path '.\requirements-dev.txt' -PathType Leaf) {pip install -r requirements-dev.txt}
- name: Install local
run: |
pip install -e ./
- name: 跑测试
if: matrix.os != 'windows-latest'
run: |
cd ./tests/
python -m unittest
- name: 跑测试(Windows系统)
if: matrix.os == 'windows-latest'
run: |
python -m unittest discover -s ./tests -p "test_*.py"