Skip to content

Commit

Permalink
refactor workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hirosassa committed Jan 19, 2025
1 parent 483aa25 commit 62f195a
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 226 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,38 @@ jobs:
- python-version: "3.12"
tox-env: py312-azureblob

steps:
- uses: actions/checkout@v4
- name: Set up the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: |
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv # we need latest uv, tox, and tox-uv
uv python install --python-preference only-managed ${{ matrix.python-version }}
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }}
run: uvx --with tox-uv tox run
- name: Upload coverage to Codecov
if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
verbose: true
others:
runs-on: ubuntu-20.04

strategy:
matrix:
include:
- python-version: "3.10"
tox-env: flake8
- python-version: "3.10"
tox-env: docs

steps:
- uses: actions/checkout@v4
- name: Set up the latest version of uv
Expand All @@ -197,6 +223,7 @@ jobs:
run: |
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv # we need latest uv, tox, and tox-uv
uv python install --python-preference only-managed ${{ matrix.python-version }}
uv python pin ${{ matrix.python-version }}
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ lint = [
]

docs = [
"sqlalchemy",
"sqlalchemy>=2",
"boto3",
"jinja2==3.0.3",
"Sphinx>=1.4.4,<2.0",
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,18 @@ builtins = unicode

[testenv:flake8]
runner = uv-venv-lock-runner
basepython=python3
dependency_groups = lint
commands =
flake8 --exclude=doc,.tox
flake8 --max-line-length=100 --ignore=E265 doc

[testenv:isort]
runner = uv-venv-lock-runner
basepython=python3
dependency_groups = lint
commands = isort -w 120 -rc luigi test examples bin

[testenv:docs]
runner = uv-venv-lock-runner
basepython=python3
# Build documentation using sphinx.
# Call this using `tox run -e docs`.
dependency_groups = docs
Expand Down
Loading

0 comments on commit 62f195a

Please sign in to comment.