Skip to content

Commit

Permalink
Set up GitHub Actions for running tests and checking types and format…
Browse files Browse the repository at this point in the history
…ting
  • Loading branch information
Tenzer committed Jun 13, 2024
1 parent e15cd3f commit 7da93a9
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: mypy

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-24.04

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: poetry

- name: Install dependencies
run: poetry install

- name: Run mypy
run: poetry run mypy --strict .
22 changes: 22 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: pre-commit

on:
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5

- name: Pre-commit
uses: pre-commit/[email protected]
36 changes: 36 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: pytest

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-24.04

strategy:
matrix:
python-version:
- "3.12"

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install dependencies
run: poetry install

- name: Run pytest
run: poetry run pytest
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ Work yet to do:

* Add tests for websocket communication
* Add way of adding TV without having to set environment variables
* Add CI for running Ruff and Mypy
* Add CI for releasing versions to PyPI when tags are added
* Add support for Python versions besides 3.12

0 comments on commit 7da93a9

Please sign in to comment.