Skip to content

[pre-commit.ci] pre-commit suggestions #68

[pre-commit.ci] pre-commit suggestions

[pre-commit.ci] pre-commit suggestions #68

Workflow file for this run

name: pytest
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: ["3.8", "3.9", "3.10"]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
timeout-minutes: 35
env:
OS: ${{ matrix.os }}
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-
- name: Install package & dependencies
run: |
python --version
pip --version
python -m pip install --upgrade pip
pip install . -U -q --find-links $TORCH_URL
pip install -r tests/requirements.txt
pip list
shell: bash
- name: Prepare Test
run: |
python tests # download test data
- name: Run Test with Coverage
run: |
coverage erase
coverage run -m pytest
- name: Generate Coverage Report
run: |
coverage report -m -i
coverage xml -i
- name: Upload Coverage to Codecov
if: runner.os != 'macOS'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false