Skip to content

Commit

Permalink
chore(ci): migrate testing to github actions (#71)
Browse files Browse the repository at this point in the history
* chore(ci): test on github actions

* chore(ci): update pre-commit config

* chore(ci): deactivate travis-ci

* lint: blacken code

* lint: isort code

* chore(ci): fix isort args for pre-commit invocation
  • Loading branch information
hairmare authored Apr 18, 2021
1 parent ed348d6 commit 6ea7166
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 28 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint and Test

on:
push:
branches-ignore:
- main
- gh-pages

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

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

- run: pip install -r requirements-dev.txt

- name: Run pre-commit
uses: pre-commit/[email protected]

pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

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

- run: pip install -r requirements-dev.txt

- run: pytest --cov=nowplaying
16 changes: 15 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ repos:
- id: isort
name: isort
language: system
entry: isort -y
entry: isort
types: [python]
- id: flake8
name: flake8
language: system
entry: flake8
types: [python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude: ^src/api/client.js$
- id: end-of-file-fixer
exclude: ^src/api/client.js$
- id: check-symlinks
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: detect-private-key
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion nowplaying/input/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import isodate
import pytz

from show import client
from show.show import Show
from track.track import DEFAULT_ARTIST, DEFAULT_TITLE, Track
Expand Down
2 changes: 1 addition & 1 deletion nowplaying/misc/saemubox.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def get_id_as_name(self, number):

if __name__ == "__main__":
# Test code
from random import randint
import sys
from random import randint

logger.addHandler(logging.StreamHandler(sys.stdout))
logger.setLevel(logging.INFO)
Expand Down
4 changes: 1 addition & 3 deletions nowplaying/track/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ def track_started(self, track):

title = track.show.name

song_string = urllib.parse.quote_plus(
"%s - %s" % (track.artist, title)
)
song_string = urllib.parse.quote_plus("%s - %s" % (track.artist, title))

update_url = self.baseUrl + song_string

Expand Down

0 comments on commit 6ea7166

Please sign in to comment.