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

Enhances nox usage #250

Merged
merged 5 commits into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pip==20.3.3
nox==2020.8.22
poetry==1.1.4
virtualenv==20.2.2
nox-poetry==0.5.0
virtualenv==20.2.1
22 changes: 0 additions & 22 deletions .github/workflows/dependabot.yml

This file was deleted.

69 changes: 56 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ jobs:
fail-fast: false
matrix:
include:
- { python-version: 3.8, os: ubuntu-latest, session: "pre-commit" }
- { python-version: 3.8, os: ubuntu-latest, session: "safety" }
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
- { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
- { python-version: 3.8, os: ubuntu-latest, session: "mypy" }
- { python-version: 3.7, os: ubuntu-latest, session: "mypy" }
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
- { python-version: 3.8, os: ubuntu-latest, session: "tests" }
- { python-version: 3.7, os: ubuntu-latest, session: "tests" }
- { python-version: 3.8, os: windows-latest, session: "tests" }
- { python-version: 3.8, os: macos-latest, session: "tests" }
# - { python-version: 3.8, os: ubuntu-latest, session: "typeguard" }
- { python-version: 3.8, os: ubuntu-latest, session: "docs-build" }
- { python-version: 3.9, os: windows-latest, session: "tests" }
- { python-version: 3.9, os: macos-latest, session: "tests" }
# - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
- { python-version: 3.9, os: ubuntu-latest, session: "docs-build" }

env:
NOXSESSION: ${{ matrix.session }}
Expand All @@ -31,7 +33,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.1
uses: actions/setup-python@v2.1.4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -47,7 +49,7 @@ jobs:

- name: Install Nox
run: |
pip install --constraint=.github/workflows/constraints.txt nox
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Compute pre-commit cache key
Expand All @@ -66,7 +68,7 @@ jobs:
print("::set-output name=result::{}".format(result))

- name: Restore pre-commit cache
uses: actions/cache@v2
uses: actions/cache@v2.1.3
if: matrix.session == 'pre-commit'
with:
path: ~/.cache/pre-commit
Expand All @@ -78,18 +80,59 @@ jobs:
run: |
nox --force-color --python=${{ matrix.python-version }}

- name: Upload coverage data
if: always() && matrix.session == 'tests'
uses: "actions/upload-artifact@v2.2.1"
with:
name: coverage-data
path: ".coverage.*"

- name: Upload documentation
if: matrix.session == 'docs-build'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.1
with:
name: docs
path: docs/_build

coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4

- name: Set up Python 3.9
uses: actions/setup-python@v2.1.4
with:
python-version: 3.9

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Install Nox
run: |
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Download coverage data
uses: actions/download-artifact@v2.0.6
with:
name: coverage-data

- name: Combine coverage data and display human readable report
run: |
nox --force-color --session=coverage

- name: Create coverage report
if: always() && matrix.session == 'tests'
run: |
nox --force-color --session=coverage -- xml

- name: Upload coverage report
if: always() && matrix.session == 'tests'
uses: codecov/codecov-action@v1.1.1
uses: codecov/codecov-action@v1.0.15
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
project = "Django Sorting Bootstrap"
author = "Thiago Carvalho D'Ávila"
copyright = f"{datetime.now().year}, {author}"
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_rtd_theme"]
autodoc_typehints = "description"
html_theme = "sphinx_rtd_theme"
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx==3.4.1
sphinx-rtd-theme==0.5.0
Loading