forked from optuna/optuna-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.37 KB
/
python-coverage.yml
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: python coverage
on:
push:
branches:
- master
pull_request: {}
jobs:
coverage:
runs-on: ubuntu-latest
# Not intended for forks.
if: github.repository == 'optuna/optuna-dashboard'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools
pip install --progress-bar off .[optional]
pip install --progress-bar off .[test]
pip install --progress-bar off .
echo 'import coverage; coverage.process_startup()' > sitecustomize.py
- name: Tests
env:
PYTHONPATH: . # To invoke sitecutomize.py
COVERAGE_PROCESS_START: .coveragerc # https://coverage.readthedocs.io/en/6.4.1/subprocess.html
COVERAGE_COVERAGE: yes # https://github.com/nedbat/coveragepy/blob/65bf33fc03209ffb01bbbc0d900017614645ee7a/coverage/control.py#L255-L261
run: |
coverage run --source=optuna_dashboard -m pytest python_tests
coverage combine
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false