|
10 | 10 |
|
11 | 11 | jobs:
|
12 | 12 | test:
|
| 13 | + name: "Tests" |
13 | 14 | runs-on: ubuntu-latest
|
14 | 15 | strategy:
|
15 | 16 | matrix:
|
16 | 17 | python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
|
17 | 18 | fail-fast: false
|
18 | 19 | steps:
|
19 |
| - - uses: actions/checkout@v2 |
20 |
| - - name: Set up Python ${{ matrix.python-version }} |
21 |
| - uses: actions/setup-python@v2 |
22 |
| - with: |
23 |
| - python-version: ${{ matrix.python-version }} |
24 |
| - - name: Install dependencies |
25 |
| - run: | |
26 |
| - python -m pip install --upgrade pip |
27 |
| - pip install -r requirements.txt |
28 |
| - pip install -r requirements_dev.txt |
29 |
| - pip install -e . |
30 |
| - - name: Test |
31 |
| - run: python setup.py test |
32 |
| - - name: Upload coverage |
33 |
| - uses: codecov/codecov-action@v1 |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Get full Python version |
| 28 | + id: full-python-version |
| 29 | + run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") |
| 30 | + |
| 31 | + - name: Bootstrap poetry |
| 32 | + run: | |
| 33 | + curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y |
| 34 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 35 | +
|
| 36 | + - name: Configure poetry |
| 37 | + run: poetry config virtualenvs.in-project true |
| 38 | + |
| 39 | + - name: Set up cache |
| 40 | + uses: actions/cache@v2 |
| 41 | + id: cache |
| 42 | + with: |
| 43 | + path: .venv |
| 44 | + key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} |
| 45 | + |
| 46 | + - name: Ensure cache is healthy |
| 47 | + if: steps.cache.outputs.cache-hit == 'true' |
| 48 | + run: timeout 10s poetry run pip --version || rm -rf .venv |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: poetry install |
| 52 | + |
| 53 | + - name: Test |
| 54 | + env: |
| 55 | + PYTEST_ADDOPTS: "--color=yes" |
| 56 | + run: poetry run pytest |
| 57 | + |
| 58 | + - name: Upload coverage |
| 59 | + uses: codecov/codecov-action@v1 |
0 commit comments