Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions for CI #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
48 changes: 48 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint & reformat

on:
pull_request:
branches: ["master"]

workflow_dispatch:

jobs:
reformat:
runs-on: ubuntu-latest
outputs:
reformatting-required: ${{ steps.push-back-to-repo.outputs.modified }}
steps:
- uses: actions/checkout@v3
with:
token : ${{ secrets.PAT }}
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install pip packages
run: python3 -m pip install --upgrade autopep8 pycodestyle eradicate
- name: Run autopep8
run: autopep8 --in-place -aa -r .
- name: Remove commented out code
run: eradicate --in-place ./**/*.py
- name: Push back to repo
id: push-back-to-repo
uses: anyone-developer/[email protected]
lint:
runs-on: ubuntu-latest
needs: reformat
if: needs.reformat.reformatting-required == 0
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install pip packages
run: python3 -m pip install --upgrade pycodestyle
- name: Run pycodestyle
run: pycodestyle --show-source --show-pep8 ./**/*.py
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pycodestyle]
max-line-length = 120
statistics = True

Empty file added test/requirements.txt
Empty file.