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