Skip to content

Commit

Permalink
🔧 Update CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yezz123 committed Jan 20, 2025
1 parent 3c48f15 commit d4bdc8c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 50 deletions.
11 changes: 0 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,3 @@ updates:
interval: "weekly"
commit-message:
prefix:
# Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
groups:
python-packages:
patterns:
- "*"
commit-message:
prefix:
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d4bdc8c

Please sign in to comment.