add test coverage

pull/531/head
88d52bdba0366127fffca9dfa93895 2023-04-28 17:55:55 +07:00
parent 2c5356f640
commit 2e49bc0499
3 changed files with 37 additions and 1 deletions

33
.github/workflows/coverage.yml vendored 100644
View File

@ -0,0 +1,33 @@
name: codecov
on: [push]
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.11'
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.11
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage1.xml,./coverage2.xml,!./cache
flags: unittests
name: codecov-umbrella
verbose: true

View File

@ -13,6 +13,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
exclude:
- os: macos-latest
python-version: "3.7"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}

View File

@ -1,4 +1,4 @@
FROM python:3.8-slim-buster
FROM python:3.11-slim-buster
WORKDIR pypfopt
COPY requirements.txt .