Skip to content
Open
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
55 changes: 55 additions & 0 deletions .github/workflows/python-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

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

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12.8
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install Black
run: pip install black
- name: Apply Black formatting
run: black .
- name: Commit formatting changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Apply Black formatting" || echo "No changes to commit"

lint:
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12.8
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install Ruff
run: pip install ruff
- name: Run Ruff linting
run: ruff check .

typecheck:
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12.8
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install mypy
run: pip install mypy
- name: Run type checks
run: mypy .
5 changes: 5 additions & 0 deletions test-ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def greet(name: int) -> str:
print("Hello, " + name + "!")
return 42

greet("world")
Loading