Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.

Commit 5759eaf

Browse files
committed
Cache poetry, remove codecov workflow, and create manual venvs
1 parent d607cc3 commit 5759eaf

File tree

2 files changed

+34
-68
lines changed

2 files changed

+34
-68
lines changed

.github/workflows/codecov.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/testing.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: test
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
48

59
jobs:
610
linting:
@@ -42,45 +46,55 @@ jobs:
4246
include-prereleases: false
4347

4448
test:
45-
needs: [linting, get-python-versions]
49+
needs: [get-python-versions]
4650
runs-on: ubuntu-latest
4751
strategy:
4852
fail-fast: false
4953
matrix:
5054
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}
5155
django-version: [ "2.2", "3.0", "3.1", "3.2" ]
5256
steps:
53-
- name: Check out repository
54-
uses: actions/checkout@v2
55-
- name: Set up python ${{ matrix.python-version }}
56-
uses: actions/setup-python@v2
57+
- uses: actions/checkout@v2
58+
- uses: actions/setup-python@v2
59+
with:
60+
python-version: "${{ matrix.python-version }}"
61+
- uses: actions/cache@v2
62+
id: poetry-cache
5763
with:
58-
python-version: ${{ matrix.python-version }}
64+
path: ~/.local
65+
key: key-0
5966
- name: Install poetry
6067
uses: snok/install-poetry@v1
6168
with:
6269
version: 1.2.0a2
63-
virtualenvs-in-project: true
64-
- name: Load cached venv
65-
uses: actions/cache@v2
70+
virtualenvs-create: false
71+
- uses: actions/cache@v2
6672
id: cache-venv
6773
with:
6874
path: .venv
69-
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-4
70-
- name: Install dependencies
71-
run: poetry install --no-interaction --no-root
75+
key: ${{ hashFiles('**/poetry.lock') }}-0
76+
77+
- run: |
78+
pip install virtualenv
79+
virtualenv .venv
80+
source .venv/bin/activate
81+
pip install pip setuptools wheel -U
82+
poetry install --no-interaction --no-root
7283
if: steps.cache-venv.outputs.cache-hit != 'true'
73-
- name: Install package
74-
run: poetry install --no-interaction
75-
- name: Install django ${{ matrix.django-version }}
76-
run: |
84+
- run: |
7785
source .venv/bin/activate
78-
poetry add "Django==${{ matrix.django-version }}"
86+
pip install "Django==${{ matrix.django-version }}"
7987
- name: Install DRF 3.11 on Django 2.2
8088
if: matrix.django-version == '2.2'
81-
run: poetry add "djangorestframework==3.11.1"
89+
run: pip install "djangorestframework==3.11.1"
8290
- name: Run tests
8391
run: |
8492
source .venv/bin/activate
85-
poetry run pytest --cov=openapi_tester --verbose --assert=plain
93+
poetry run pytest --cov=openapi_tester --verbose --assert=plain --cov-report=xml
8694
poetry run coverage report
95+
- uses: codecov/codecov-action@v2
96+
with:
97+
file: ./coverage.xml
98+
fail_ci_if_error: true
99+
token: ${{ secrets.CODECOV_TOKEN }}
100+
if: matrix.python-version == '3.10'

0 commit comments

Comments
 (0)