update #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Coverage | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
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 numpy pandas==1.5.3 pytest coverage coveralls gitpython # 添加 gitpython 库 | |
- name: Run tests with coverage | |
run: | | |
coverage run -m pytest | |
coverage report | |
coverage xml | |
- name: Upload coverage to Coveralls | |
run: coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} # 使用 GitHub Secrets 中的令牌 |