-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (38 loc) · 1.19 KB
/
pytest.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
name: Pytest
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest]
steps:
- name: 检出仓库
uses: actions/checkout@v4
- name: 安装Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 安装Poetry
uses: abatilo/actions-poetry@v2
- name: 设置本地venv
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: 使用缓存
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: 安装依赖
run: poetry install
- name: 运行测试
run: poetry run pytest --cov=./ --cov-report=xml
- name: 上传到codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
slug: XYCode-Kerman/YiriMiraiOneBot
env_vars: OS,PYTHON