JMComic-Crawler-Python/.github/workflows/test.yml
hect0x7 10ef575779
v2.0.0: 一次大版本更新 (#33)
- 重构JmcomicClient,重新设计抽象层次,以及两种实现:HTMl、API,支持请求重试+域名更换的机制;
- 重构JmOption,更加优雅、简单的配置,支持更多文件类型;
- 优化debug机制,等等。
2023-05-10 22:02:42 +08:00

57 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 跑测试
on:
push:
branches: [ "dev", "master" ]
paths:
- '.github/workflows/*.yml' # 工作流定义
- 'usage/**/*.py' # 工作流脚本
- 'assets/config/*.yml' # option配置文件
- 'src/**/*.py' # 源码
- 'tests/**/*.py' # 测试代码
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"