Skip to content
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

CICD: Add Python workflow #17

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Python

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
lint:
name: "Code style"
runs-on: ubuntu-latest

steps:
- name: "Checkout sources"
uses: actions/checkout@v3

- name: "Set up Python 3.11"
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install tox

- name: "Lint Python code"
run: |
cd ${GITHUB_WORKSPACE}/python && tox -e lint
env:
PLATFORM: ubuntu-latest

py_success:
name: "Python success"
runs-on: ubuntu-latest
needs: [lint]
steps:
- run: echo "Python workflow completed successfully"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- CICD: Add Python workflow

## [2.0.0] - 2024-07-25

### Added
Expand Down
27 changes: 27 additions & 0 deletions python/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tox]
isolated_build = True
env_list = py

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv:lint]
deps =
black >=22.10.0
ruff >=0.5.4
mypy >=0.812
pylint >=2.8.2
commands =
black --check --diff upkie_description
mypy upkie_description --config-file {toxinidir}/tox.ini
pylint upkie_description --exit-zero --rcfile={toxinidir}/tox.ini
ruff check upkie_description
ruff format --check upkie_description

[mypy]
ignore_missing_imports = True
Loading