Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
myoung34 committed Jul 10, 2020
1 parent f35feb2 commit 1892d61
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 68 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,11 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: install pre-reqs
run: sudo apt-get update && sudo apt-get install libbluetooth-dev && pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: isort
run: isort -c -rc tilty -sp .
- name: pylint
run: pylint --rcfile .pylintrc -r n tilty
run: sudo apt-get update && sudo apt-get install libbluetooth-dev python3-venv && pip install poetry tox-gh-actions && pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: set pythonpath
run: echo "::set-env name=PYTHONPATH::$(pwd)"
- name: pytest
run: py.test --cov-config .coveragerc --cov tilty --cov-report term-missing --cov-report xml --junitxml junit.xml tests
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: tests
run: poetry run tox
latest_deploy:
runs-on: ubuntu-latest
needs: [test]
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,27 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: install pre-reqs
run: sudo apt-get update && sudo apt-get install libbluetooth-dev && pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: isort
run: isort -c -rc tilty -sp .
- name: pylint
run: pylint --rcfile .pylintrc -r n tilty
run: sudo apt-get update && sudo apt-get install libbluetooth-dev python3-venv && pip install poetry tox-gh-actions && pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: set pythonpath
run: echo "::set-env name=PYTHONPATH::$(pwd)"
- name: pytest
run: py.test --cov-config .coveragerc --cov tilty --cov-report term-missing --cov-report xml --junitxml junit.xml tests
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
- name: tests
run: poetry run tox
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
upload_to_pypi:
runs-on: ubuntu-latest
needs: [test]
Expand Down
45 changes: 28 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ on:
branches-ignore:
- 'master'
- 'refs/tags/*'
#on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8' ]
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: lint
run: |
pip install pre-commit
pre-commit run --all-files
test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -21,26 +36,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Get short Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))"| sed 's/\([0-9]\)-\([0-9]\).*/py\1\2/g')
- name: install pre-reqs
run: sudo apt-get update && sudo apt-get install libbluetooth-dev && pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: isort
run: isort -c -rc tilty -sp .
- name: pylint
run: pylint --rcfile .pylintrc -r n tilty
- name: set pythonpath
run: echo "::set-env name=PYTHONPATH::$(pwd)"
- name: pytest
run: py.test --cov-config .coveragerc --cov tilty --cov-report term-missing --cov-report xml --junitxml junit.xml tests
run: sudo apt-get update && sudo apt-get install libbluetooth-dev && pip install poetry
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Run tox
run: poetry run tox -e ${{ steps.full-python-version.outputs.version }}
- name: coveralls
run: coveralls
run: poetry run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
clair:
runs-on: ubuntu-latest
steps:
Expand Down
119 changes: 114 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 2 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Marcus Young <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
python = ">=3.6,<3.8"
python = ">=3.6"
click = "^7.0"
pybluez = "^0.22.0"
requests = "^2.22"
Expand All @@ -23,23 +23,4 @@ pytest-cov = "^2.8"
coverage = "^5.0"
isort = "^4.3"
tox = "^3.14"

[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py37
skipsdist = True
toxworkdir=.tox
usedevelop=True
[testenv]
commands =
isort -c -rc tilty -sp {toxinidir}
pylint --rcfile {toxinidir}/.pylintrc -r n tilty
py.test --cov-config .coveragerc --cov tilty --cov-report term-missing --cov-report xml --junitxml junit.xml tests {posargs}
whitelist_externals = make
bash
pylint
"""
bandit = "^1.6.2"
1 change: 1 addition & 0 deletions tilty/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
""" Misc methods """


def f_to_c(f=0):
""" Convert fahrenheight to celcius """
return round((f - 32.0) / 1.8, 2)
Loading

0 comments on commit 1892d61

Please sign in to comment.