Skip to content

Commit

Permalink
ci: some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Dec 2, 2021
1 parent 19f277b commit 0661d34
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ on:
branches:
- master

env:
PYTEST_ADDOPTS: "--color=yes"

# Set permissions at the job level.
permissions: {}

jobs:
test:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.allow_failure }}
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- uses: actions/setup-python@v2
with:
Expand All @@ -37,15 +48,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==3.20.0
pip install tox==3.24.4
- name: Run tox
run: tox -e ${{ matrix.name }}

- name: Report coverage
if: contains(matrix.name, 'coverage')
run: |
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X xcode -X gcovout
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage.xml

strategy:
fail-fast: false
Expand Down Expand Up @@ -128,11 +141,15 @@ jobs:
deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest-django'
runs-on: ubuntu-20.04
timeout-minutes: 15
permissions:
contents: read

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@v2
with:
Expand All @@ -141,10 +158,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools tox
pip install --upgrade build tox
- name: Build package
run: python setup.py sdist bdist_wheel
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.4.1
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ VENV:=build/venv

export DJANGO_SETTINGS_MODULE?=pytest_django_test.settings_sqlite_file

testenv: $(VENV)/bin/pytest

test: $(VENV)/bin/pytest
$(VENV)/bin/pip install -e .
$(VENV)/bin/py.test
$(VENV)/bin/pytest

$(VENV)/bin/python $(VENV)/bin/pip:
virtualenv $(VENV)
Expand Down

0 comments on commit 0661d34

Please sign in to comment.