Maintenance updates: docformatter fixes, and mypy/docs updates #153
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Checks | |
env: | |
DEFAULT_PYTHON: 3.8 | |
PACKAGES_PATH: .dwas/cache/package/ | |
COVERAGE_FILES_PATH: .dwas/cache/pytest-*/reports/coverage | |
TERM: "xterm-256color" | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# Use the concurrency feature to ensure we don't run redundant workflows | |
# | |
concurrency: | |
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
session: | |
- black | |
- docformatter | |
- isort | |
- mypy | |
- pylint | |
- unimport | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
cache: pip | |
# FIXME: we should take dwas from pypi once it's published | |
- name: Install dwas | |
run: python -m pip install . | |
- name: ${{ matrix.session }} | |
run: dwas --verbose --only ${{ matrix.session }} | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
cache: pip | |
# FIXME: we should take dwas from pypi once it's published | |
- name: Install dwas | |
run: python -m pip install . | |
- name: package | |
run: dwas --verbose --only package | |
- name: Save packaged dist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ${{ env.PACKAGES_PATH }}/* | |
retention-days: 7 | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: package | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "pypy3.8" | |
include: | |
- os: macos-latest | |
python: "3.8" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: pip | |
# FIXME: we should take dwas from pypi once it's published | |
- name: Install dwas | |
run: python -m pip install . | |
- name: Download packaged dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: ${{ env.PACKAGES_PATH }} | |
- name: pytest[${{ matrix.python }}] | |
run: dwas --verbose --only pytest[${{ matrix.python }}] -- ${{ startsWith(matrix.python, 'pypy') && '' || '--numprocesses 2' }} | |
- name: Move the coverage to another place to avoid conflicts | |
if: runner.os != 'Linux' | |
run: mv .dwas/cache/pytest-* .dwas/cache/pytest-${{ matrix.os }} | |
- name: Save coverage files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-files-pytest-${{ matrix.os }}-${{ matrix.python }} | |
path: ${{ env.COVERAGE_FILES_PATH }} | |
retention-days: 7 | |
coverage: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
cache: pip | |
# FIXME: we should take dwas from pypi once it's published | |
- name: Install dwas | |
run: python -m pip install . | |
# This will download add artifacts that were generated before, which is not ideal | |
# as we only need some of them, but it's simpler than having to repeat them one by one | |
- name: Download generated coverage files | |
uses: actions/download-artifact@v3 | |
with: | |
path: _cache | |
- name: Move artifacts to the right place | |
run: mkdir -p .dwas/cache && mv _cache/*/pytest-* .dwas/cache && rm -rf _cache && ls -lR .dwas/cache | |
- name: Generate coverage report | |
run: dwas --verbose --only coverage | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./_artifacts/coverage/coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
- name: Save coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage [html] | |
path: _artifacts/coverage/html | |
retention-days: 7 | |
twine: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
cache: pip | |
- name: Download packaged dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: ${{ env.PACKAGES_PATH }} | |
# FIXME: we should take dwas from pypi once it's published | |
- name: Install dwas | |
run: python -m pip install . | |
- name: Validate packages with twine | |
run: dwas --verbose --only twine:check |