Skip to content

Merge branch 'dev-0.3' of https://github.com/NJUNLP/pydec into dev-0.3 #253

Merge branch 'dev-0.3' of https://github.com/NJUNLP/pydec into dev-0.3

Merge branch 'dev-0.3' of https://github.com/NJUNLP/pydec into dev-0.3 #253

name: Test
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
pytorch-version: ["1.13.1", "2.0.1"]
max-parallel: 4
env:
OS: 'ubuntu-latest'
PYTHON: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.py
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies with PyTorch ${{ matrix.pytorch-version }}
run: |
python -m pip install --upgrade pip setuptools wheel
pip install torch==${{ matrix.pytorch-version }}
pip install black pytest pytest-cov
pip install .
- name: Python Lint (isort/black)
# You may pin to the exact commit or the version.
# uses: wrboyce/python-lint-action@7c6d719c086f19e7eeb802c3fbdeeff6c01cab61
uses: wrboyce/[email protected]
continue-on-error: true
- name: Test with pytest
run: |
pytest --cov=./pydec --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
name: codecov-umbrella
verbose: true