-
-
Notifications
You must be signed in to change notification settings - Fork 228
Speed up and simplify github workflows #1128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
188a0fc
df2e324
4a787a6
9db779b
df301e6
b9db613
371bbdb
bbf1667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
workflow_dispatch: # to allow manual re-runs | ||
|
||
env: | ||
UV_VERSION: 0.4.5 | ||
UV_VERSION: 0.4.16 | ||
|
||
jobs: | ||
linting: | ||
|
@@ -20,39 +20,19 @@ jobs: | |
python-version: ["3.12"] | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: "Checkout source files" | ||
uses: "actions/checkout@v4" | ||
- name: Setup environment | ||
uses: ./.github/actions/setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache-pre-commit: true | ||
uv-version: ${{ env.UV_VERSION }} | ||
uv-install-options: "--all-extras" | ||
- name: "Check supported device md files are up to date" | ||
run: | | ||
uv run pre-commit run generate-supported --all-files | ||
- name: "Linting and code formating (ruff)" | ||
run: | | ||
uv run pre-commit run ruff --all-files | ||
- name: "Typing checks (mypy)" | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run mypy --all-files | ||
- name: "Run trailing-whitespace" | ||
run: | | ||
uv run pre-commit run trailing-whitespace --all-files | ||
- name: "Run end-of-file-fixer" | ||
run: | | ||
uv run pre-commit run end-of-file-fixer --all-files | ||
- name: "Run check-docstring-first" | ||
run: | | ||
uv run pre-commit run check-docstring-first --all-files | ||
- name: "Run debug-statements" | ||
run: | | ||
uv run pre-commit run debug-statements --all-files | ||
- name: "Run check-ast" | ||
|
||
- name: "Run pre-commit checks" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we were missing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, no need to repeat oneself here, I have been wanting to do this for a while 👍 |
||
run: | | ||
uv run pre-commit run check-ast --all-files | ||
pre-commit run --all-files --verbose | ||
|
||
|
||
tests: | ||
|
@@ -83,6 +63,13 @@ jobs: | |
- os: ubuntu-latest | ||
python-version: "3.10" | ||
extras: true | ||
# Exclude pypy on windows due to significant performance issues | ||
# running pytest | ||
sdb9696 marked this conversation as resolved.
Show resolved
|
||
- os: windows-latest | ||
python-version: "pypy-3.9" | ||
- os: windows-latest | ||
python-version: "pypy-3.10" | ||
|
||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
@@ -95,11 +82,11 @@ jobs: | |
- name: "Run tests (no coverage)" | ||
if: ${{ startsWith(matrix.python-version, 'pypy') }} | ||
run: | | ||
uv run pytest | ||
uv run pytest -n auto | ||
- name: "Run tests (with coverage)" | ||
if: ${{ !startsWith(matrix.python-version, 'pypy') }} | ||
run: | | ||
uv run pytest --cov kasa --cov-report xml | ||
uv run pytest -n auto --cov kasa --cov-report xml | ||
- name: "Upload coverage to Codecov" | ||
if: ${{ !startsWith(matrix.python-version, 'pypy') }} | ||
uses: "codecov/codecov-action@v4" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This became an official astral action a few weeks ago and makes life so much easier that we don't have to do the
pipx
caching manually that we had to forpoetry
.