-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
75 additions
and
120 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,47 +3,76 @@ on: | |
push: | ||
pull_request: | ||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
- run: python -m pip install --upgrade pip wheel | ||
- run: pip install tox | ||
- run: tox -elint | ||
tests: | ||
name: ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- {name: '3.8', python: '3.8', tox: py38} | ||
- {name: '3.12', python: '3.12', tox: py312} | ||
- { name: '3.8', python: '3.8', tox: py38 } | ||
- { name: '3.12', python: '3.12', tox: py312 } | ||
steps: | ||
- uses: actions/checkout@v3.1.0 | ||
- uses: actions/setup-python@v4.3.0 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
allow-prereleases: true | ||
- name: Run test | ||
run: | | ||
python -m pip install --upgrade pip wheel | ||
pip install tox | ||
tox -e${{ matrix.tox }} | ||
python -m pip install tox | ||
python -m tox -e ${{ matrix.tox }} | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
release: | ||
needs: [lint, tests] | ||
name: PyPI release | ||
build: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install pypa/build | ||
run: python -m pip install build | ||
- name: Build a binary wheel and a source tarball | ||
run: python -m build | ||
- name: Install twine | ||
run: python -m pip install twine | ||
- name: Check build | ||
run: python -m twine check --strict dist/* | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
# this duplicates pre-commit.ci, so only run it on tags | ||
# it guarantees that linting is passing prior to a release | ||
lint-pre-release: | ||
if: startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- run: python -m pip install --upgrade pip wheel | ||
- run: pip install twine | ||
- run: python setup.py sdist bdist_wheel | ||
- run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- run: python -m pip install tox | ||
- run: python -m tox -e lint | ||
publish-to-pypi: | ||
name: PyPI release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [build, tests, lint-pre-release] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/flask-smorest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution to PyPI | ||
# TODO: Configure GH permissions, remove TOKEN | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
repos: | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.15.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.2.2 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py38-plus] | ||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
- id: ruff | ||
- id: ruff-format | ||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.28.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-bugbear==24.2.6] | ||
- id: check-github-workflows | ||
- id: check-readthedocs | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: 1.16.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==22.3.0] | ||
additional_dependencies: [black==23.12.1] |
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
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
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
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
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