-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
ad8c2bf
commit 9b32aee
Showing
4 changed files
with
164 additions
and
39 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Always build & lint package. | ||
build-package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hynek/build-and-inspect-python-package@v1 | ||
|
||
# Upload to Test PyPI on every commit on main. | ||
release-test-pypi: | ||
name: Publish in-dev package to test.pypi.org | ||
if: | | ||
github.repository_owner == 'WindowGenerator42' | ||
&& github.event_name == 'push' | ||
&& github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Upload package to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
# Upload to real PyPI on GitHub Releases. | ||
release-pypi: | ||
name: Publish released package to pypi.org | ||
if: | | ||
github.repository_owner == 'WindowGenerator42' | ||
&& github.event.action == 'published' | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Upload package to PyPI | ||
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
|
||
name: Tests | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# when adding new versions, update the one used to test | ||
# friend projects below to the latest one | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
cache: pip | ||
cache-dependency-path: .github/workflows/tests.yml | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U wheel | ||
python -m pip install -U tox | ||
- name: Download more tests from friend projects | ||
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' | ||
run: sh download-more-tests.sh | ||
- name: Tox tests | ||
run: | | ||
tox -e py | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
flags: ${{ matrix.os }} | ||
name: ${{ matrix.os }} Python ${{ matrix.python-version }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[tox] | ||
requires = | ||
tox>=4.2 | ||
env_list = | ||
lint | ||
py{py3, 312, 311, 310, 39, 38} | ||
|
||
[testenv] | ||
extras = | ||
tests | ||
pass_env = | ||
FORCE_COLOR | ||
commands = | ||
{envpython} -m pytest \ | ||
--cov starlette_responses_kit \ | ||
--cov tests \ | ||
--cov-report html \ | ||
--cov-report term \ | ||
--cov-report xml \ | ||
{posargs} | ||
|
||
[testenv:lint] | ||
skip_install = true | ||
deps = | ||
pre-commit | ||
pass_env = | ||
PRE_COMMIT_COLOR | ||
commands = | ||
pre-commit run --all-files --show-diff-on-failure |