Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Nov 6, 2023
1 parent 92773b6 commit 4a58d29
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/lint-mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Typing with mypy

on: workflow_dispatch
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install voluptuous
- name: Check with mypy
run: |
pip install mypy
mypy evohomeasync/ evohomeasync2/
- run: echo "🍏 This job's status is ${{ job.status }}."
20 changes: 20 additions & 0 deletions .github/workflows/lint-ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# https://docs.astral.sh/ruff/integrations/#github-actions

name: Linting with ruff

on: workflow_dispatch # [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4

- uses: chartboost/ruff-action@v1
43 changes: 43 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
build-and-deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/test-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Testing with pytest

on:
workflow_dispatch:
push:
branches: [ "stable" ]
# pull_request:
# branches: [ "stable" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Install the package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest
# - name: Test with without voluptuous
# run: |
# pip uninstall -y voluptuous
# pytest
# continue-on-error: true


- run: echo "🍏 This job's status is ${{ job.status }}."

0 comments on commit 4a58d29

Please sign in to comment.