Skip to content

Commit

Permalink
Add workflows for black, flake8, reuse and unittests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Sep 11, 2023
1 parent a3824bf commit e09a204
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: black

on: [pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
- name: Analysing the code with black
run: black --check $(git ls-files '*.py')
19 changes: 19 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: flake8

on: [pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install flake8
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Analysing the code with flake8
run: flake8 --select=W504 --ignore=E203,W503 --max-line-length=120 $(git ls-files '*.py')
19 changes: 19 additions & 0 deletions .github/workflows/reuse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: reuse

on: [pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install reuse
run: |
python -m pip install --upgrade pip
pip install reuse
- name: Analysing the code with reuse
run: reuse lint
20 changes: 20 additions & 0 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Unit Tests Transformer

on: [pull_request]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install black
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install .
- name: Run unit tests
run: python -m unittest Tests/TestTransformer.py

0 comments on commit e09a204

Please sign in to comment.