Add codespell support (config, workflow to detect/not fix) and make i… #63
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: CD | |
on: | |
push: | |
branches: | |
- main | |
- master | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
coverage: | |
name: Deploy Coverage Results | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
python -m pip install .[test,optional] | |
- name: Run Tests | |
shell: bash -l {0} | |
run: | | |
pytest -n auto --cov=patch_denoise --cov-report xml:coverage.xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
flags: unittests # optional | |
file: coverage.xml | |
name: codecov-umbrella # optional | |
fail_ci_if_error: false # optional (default = false) | |
verbose: true # optional (default = false) | |
makedocs: | |
name: Deploy API Documentation | |
runs-on: ubuntu-latest | |
if: success() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get history and tags for SCM versioning to work | |
run: | | |
git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[optional,doc] | |
- name: Build API documentation | |
run: | | |
python -m sphinx docs docs_build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: 'docs_build' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
build-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to TestPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get history and tags for SCM versioning to work | |
run: | | |
git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install pypa/build | |
run: | | |
python -m pip install build twine | |
python -m pip install . | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Check Dist | |
run: | | |
python -m twine check dist/* | |
- name: Upload to Test PyPI | |
run: | | |
python -m twine upload -r testpypi -u __token__ -p ${{ secrets.TEST_PYPI_API }} dist/* |