sqlmodel/.github/workflows/test.yml

45 lines
1.3 KiB
YAML
Raw Normal View History

name: Test
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test
- name: Install poetry
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install "poetry>=1.2.0a1"
python -m poetry plugin add poetry-version-plugin
- name: Configure poetry
run: python -m poetry config virtualenvs.in-project true
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: python -m poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: python -m poetry install
- name: Test
run: bash scripts/test.sh
- name: Upload coverage
uses: codecov/codecov-action@v1