|
|
name: test |
|
|
|
|
|
on: [push, pull_request] |
|
|
|
|
|
jobs: |
|
|
test: |
|
|
strategy: |
|
|
matrix: |
|
|
python-version: [ "3.7", "3.8", "3.9" ] |
|
|
os: [ubuntu-latest] |
|
|
runs-on: ${{ matrix.os }} |
|
|
steps: |
|
|
- uses: actions/checkout@v2 |
|
|
- name: Set up Python ${{ matrix.python-version }} |
|
|
uses: actions/setup-python@v2.2.1 |
|
|
with: |
|
|
python-version: ${{ matrix.python-version }} |
|
|
|
|
|
- name: Install poetry |
|
|
run: curl -sSL https://install.python-poetry.org | python3 - |
|
|
|
|
|
- name: Set up cache |
|
|
uses: actions/cache@v2.1.3 |
|
|
with: |
|
|
path: .venv |
|
|
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} |
|
|
|
|
|
- name: Check poetry config |
|
|
run: | |
|
|
echo $HOME |
|
|
ls $HOME -a |
|
|
poetry config --list |
|
|
|
|
|
- name: Install dependencies |
|
|
run: | |
|
|
poetry config virtualenvs.in-project true |
|
|
poetry install |
|
|
|
|
|
- name: Run tests |
|
|
run: | |
|
|
poetry run pytest |
|
|
|