-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (29 loc) · 953 Bytes
/
python-package.yml
File metadata and controls
32 lines (29 loc) · 953 Bytes
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
name: Python package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
CODECOV_URL: http://codedev.tdengine.net:5080
CODECOV_TOKEN: a666720c-cef4-4786-859b-1f004cf91999
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
- name: Run tests with coverage
run: |
pytest --cov=test_calculator --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
codecov_url: http://codedev.tdengine.net:5080
token: a666720c-cef4-4786-859b-1f004cf91999
slug: jiajingbin/codecov-example
file: ./coverage.xml # 指定覆盖率文件的路径
fail_ci_if_error: true # 可选的,如果上传失败则使CI失败