Skip to content

Correct URL to flake8. #106

Correct URL to flake8.

Correct URL to flake8. #106

Workflow file for this run

# check spelling, codestyle
name: GitHub CI
# run only on main branch. This avoids duplicated actions on PRs
on:
pull_request:
push:
tags:
- "*"
branches:
- main
jobs:
style:
name: Pre-commit Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pre-commit requirements
run: |
pip install poetry
poetry install -E pre-commit
- name: Run pre-commit
run: |
poetry run pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run dotnet build
run: |
cd PythonLogging
dotnet build -c Release
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Create wheel
run: |
pip install poetry
poetry build -f wheel -vvv
- uses: actions/upload-artifact@v3
with:
name: PythonLogging
path: src/py_mel_logging/dlls
retention-days: 7
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: py-mel-logging-wheel
path: dist/py_mel_logging-0.1.dev1-py3-none-any.whl
retention-days: 7
testing:
name: Testing
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel
uses: actions/download-artifact@v3
with:
name: py-mel-logging-wheel
- name: Install library, with test extra
run: pip install .[test]
- name: Install Wheel
run: pip install --force-reinstall -v py_mel_logging-0.1.dev1-py3-none-any.whl
- name: Unit testing
run: |
cd tests # so we're testing the install, not local
pytest -vx
docs:
name: Build Documentation
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: PythonLogging
path: dlls/
- name: Display structure of downloaded files
run: ls -R
working-directory: dlls
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install library, with docs extra
run: |
pip install poetry
poetry install -E docs
- name: Build HTML
run: |
poetry run make -C doc html SPHINXOPTS="-W"
# - name: Build PDF Documentation
# run: |
# sudo apt update
# sudo apt-get install -y texlive-latex-extra latexmk
# poetry run make -C doc latexpdf
- name: Upload HTML Documentation
uses: actions/upload-artifact@v2
with:
name: Documentation-html
path: doc/build/html
retention-days: 7
# - name: Upload PDF Documentation
# uses: actions/upload-artifact@v2
# with:
# name: Documentation-pdf
# path: doc/build/latex/*.pdf
# retention-days: 7
- name: Deploy to gh-pages
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: doc/build/html
CLEAN: true
single-commit: true
Release:
if: contains(github.ref, 'refs/tags')
needs: [build, testing, style, docs]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: py-mel-logging-wheel
# - uses: actions/download-artifact@v2
# with:
# name: Documentation-pdf
- uses: actions/download-artifact@v2
with:
name: Documentation-html
path: ~/html
# list current directory
- name: List directory structure
run: ls -R
- name: Deploy
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: ~/html
CLEAN: true
# note how we use the PyPI tokens
- name: Upload to Azure PyPi (disabled)
run: |
pip install twine
# twine upload --skip-existing ./**/*.whl
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./**/*.whl
./**/*.zip
./**/*.pdf