-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
3 changed files
with
32 additions
and
50 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
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 |
---|---|---|
|
@@ -7,11 +7,11 @@ on: | |
pull_request: {} | ||
|
||
jobs: | ||
lint: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
python-version: ["3.12"] | ||
fail-fast: false | ||
|
||
steps: | ||
|
@@ -27,13 +27,10 @@ jobs: | |
uv-venv: ".venv" | ||
|
||
- name: Install Dependencies | ||
run: uv pip install -r requirements/pyproject.txt && uv pip install -r requirements/linting.txt | ||
run: uv sync --group lint --all-extras | ||
|
||
- name: Run Pre-commit | ||
run: bash scripts/format.sh | ||
|
||
- name: Run Mypy | ||
run: bash scripts/lint.sh | ||
- name: Typecheck with mypy | ||
run: bash scripts/mypy.sh | ||
|
||
tests: | ||
|
||
|
@@ -46,9 +43,9 @@ jobs: | |
|
||
matrix: | ||
|
||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
||
os: [ubuntu, macos, windows] | ||
os: [ubuntu] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -58,16 +55,13 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: setup uv | ||
- name: setup UV | ||
uses: yezz123/[email protected] | ||
with: | ||
uv-venv: ".venv" | ||
|
||
- name: Install Dependencies | ||
run: uv pip install -r requirements/pyproject.txt && uv pip install -r requirements/testing.txt | ||
|
||
- name: Freeze Dependencies | ||
run: uv pip freeze | ||
run: uv sync --group test --all-extras | ||
|
||
- name: Test with pytest - ${{ matrix.os }} - py${{ matrix.python-version }} | ||
run: bash scripts/test.sh | ||
|
@@ -78,12 +72,14 @@ jobs: | |
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
files: ./coverage.xml | ||
|
||
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | ||
# https://github.com/marketplace/actions/alls-green#why | ||
# used for branch protection checks | ||
check: | ||
if: always() | ||
needs: [lint, tests] | ||
|
||
needs: [mypy, tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
|
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 |
---|---|---|
|
@@ -6,31 +6,28 @@ on: | |
- created | ||
|
||
jobs: | ||
publish: | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
|
||
- uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install build dependencies | ||
run: pip install build | ||
- name: check GITHUB_REF matches package version | ||
enable-cache: true | ||
|
||
- name: check version | ||
id: check-tag | ||
uses: samuelcolvin/[email protected] | ||
with: | ||
version_file_path: fastapi_class/__init__.py | ||
- name: Build distribution | ||
run: python -m build | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
|
||
- name: build | ||
run: uv build | ||
|
||
- name: Upload package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |