From e09a2041141e571df22eee63ae4b5d02a7f4767b Mon Sep 17 00:00:00 2001 From: Rot127 Date: Mon, 11 Sep 2023 13:16:40 -0500 Subject: [PATCH] Add workflows for black, flake8, reuse and unittests. --- .github/workflows/black.yaml | 19 +++++++++++++++++++ .github/workflows/flake8.yml | 19 +++++++++++++++++++ .github/workflows/reuse.yaml | 19 +++++++++++++++++++ .github/workflows/unittests.yaml | 20 ++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 .github/workflows/black.yaml create mode 100644 .github/workflows/flake8.yml create mode 100644 .github/workflows/reuse.yaml create mode 100644 .github/workflows/unittests.yaml diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..60f8aa6 --- /dev/null +++ b/.github/workflows/black.yaml @@ -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') diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..770ce33 --- /dev/null +++ b/.github/workflows/flake8.yml @@ -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') diff --git a/.github/workflows/reuse.yaml b/.github/workflows/reuse.yaml new file mode 100644 index 0000000..529afef --- /dev/null +++ b/.github/workflows/reuse.yaml @@ -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 diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml new file mode 100644 index 0000000..3c4134f --- /dev/null +++ b/.github/workflows/unittests.yaml @@ -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