Skip to content

Dockerfile to get things running and tests passing #286

Dockerfile to get things running and tests passing

Dockerfile to get things running and tests passing #286

Workflow file for this run

name: tests
on:
- push
- pull_request
jobs:
test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
pytorch-version: [1.7, 1.8]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache installed requirements
uses: actions/cache@v2
with:
# Cache the Python package environment, excluding pip and setuptools installed by setup-python
path: |
~/.cache/pip
${{ env.pythonLocation }}/bin/*
${{ env.pythonLocation }}/include
${{ env.pythonLocation }}/lib/python*/site-packages/*
!${{ env.pythonLocation }}/bin/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/setuptools*
key: ${{ matrix.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
- name: Install tox, tox-gh-actions and coveralls
run: pip install tox==3.21.3 tox-gh-actions==2.4.0 coveralls==3.0.0
- name: Lint using flake8
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.6' && matrix.pytorch-version == '1.8' }}
run: tox -e flake8
- name: Run tests with tox
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
PYTORCH: ${{ matrix.pytorch-version }}
run: tox
- name: Upload coverage.xml
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' && matrix.pytorch-version == '1.8' }}
uses: actions/upload-artifact@v2
with:
name: tox-gh-actions-coverage
path: coverage.xml
if-no-files-found: error
- name: Coveralls
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' && matrix.pytorch-version == '1.8' }}
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}