* add a workflow to profile batch * buffer profiling * collector profiling Co-authored-by: Trinkle23897 <463003665@qq.com> Co-authored-by: Huayu Chen(陈华玉) <chenhuay17@gamil.com>
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Unittest
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.6, 3.7, 3.8]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
# - uses: actions/cache@v2
|
|
# with:
|
|
# path: /opt/hostedtoolcache/Python/
|
|
# key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}
|
|
# restore-keys: |
|
|
# ${{ runner.os }}-${{ matrix.python-version }}-
|
|
- name: Upgrade pip
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install ".[dev]" --upgrade
|
|
- name: Test with pytest
|
|
# ignore test/throughput which only profiles the code
|
|
run: |
|
|
pytest test --ignore-glob='*profile.py' --cov=tianshou --cov-report=xml --durations=0 -v
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
token: ${{ secrets.CODECOV }}
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|