Repository: moshi4/FastDTLmapper (language: python)

Issue:
Add python formatter linter github actions
Formatter = black
Linter = flake8
Add automated pytest coverage github actions
**Test environment**
- OS: Ubuntu 20.04
- Lang: Python 3.7, 3.8, 3.9
Add automated pytest coverage github actions
**Test environment**
- OS: Ubuntu 20.04
- Lang: Python 3.7, 3.8, 3.9
Add automated pytest coverage github actions
**Test environment**
- OS: Ubuntu 20.04
- Lang: Python 3.7, 3.8, 3.9


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
new file mode 100644
index 0000000..5f4f529
--- /dev/null
+++ b/.github/workflows/CI.yml
@@ -0,0 +1,48 @@
+name: CI
+on:
+  push:
+    branches: main
+    paths: ["src/**", "tests/**", ".github/workflows/**"]
+  pull_request:
+    branches: main
+    paths: ["src/**", "tests/**", ".github/workflows/**"]
+
+jobs:
+  CI_black-flake8-pytest:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.7, 3.8, 3.9]
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Setup Python {{ matrix.python-version}}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+
+      - name: Install Poetry
+        run: |
+          curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
+          echo "$HOME/.poetry/bin" >> $GITHUB_PATH
+
+      - name: Install Dependencies
+        run: poetry install -n
+
+      - name: Run black format check
+        run: poetry run black src tests --check --diff --verbose --exclude src/fastdtlmapper/bin
+
+      - name: Run flake8 lint check
+        run: poetry run flake8 src tests --max-line-length=88 --ignore=E203,W503,W504 --exclude src/fastdtlmapper/bin
+
+      - name: Run pytest
+        run: poetry run pytest tests --tb=line --cov=src --cov-report=xml --cov-report=term
+
+      - name: Upload coverage to Codecov
+        if: ${{ matrix.python-version==3.8 }}
+        uses: codecov/codecov-action@v2
+        with:
+          name: pytest-codecov
+          files: coverage.xml
+          fail_ci_if_error: true
diff --git a/README.md b/README.md
index 3c82531..bfa38f2 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,9 @@
 ![OS](https://img.shields.io/badge/OS-Linux-steelblue)
 ![License](https://img.shields.io/badge/License-GPL3.0-steelblue)  
 
+![CI workflow](https://github.com/moshi4/FastDTLmapper/actions/workflows/CI.yml/badge.svg)
+[![codecov](https://codecov.io/gh/moshi4/FastDTLmapper/branch/main/graph/badge.svg?token=ZJ8D747JUY)](https://codecov.io/gh/moshi4/FastDTLmapper)
+
 ## Table of contents
 
 - [Overview](#overview)
@@ -19,7 +22,7 @@ driving adaptive evolution, but it remains largely unexplored.
 Therefore, to investigate the relationship between gene gain/loss and adaptive evolution
 in the evolutionary process of organisms, I developed a software pipeline **FastDTLmapper**
 which automatically estimates and maps genome-wide gene gain/loss.  
-FastDTLmapper takes two inputs, 1. Species tree (Newick format) 2. Genomic CDSs (Fasta|Genbank format), 
+FastDTLmapper takes two inputs, 1. Species tree (Newick format) 2. Genomic CDSs (Fasta|Genbank format),
 and performs genome-wide mapping of DTL(Duplication-Transfer-Loss) events by
 DTL reconciliation of species tree and gene trees.  
 


Test patch:
diff --git a/tests/test_cmd.py b/tests/test_cmd.py
index 1479650..35278b9 100644
--- a/tests/test_cmd.py
+++ b/tests/test_cmd.py
@@ -108,14 +108,3 @@ def test_get_parallel_cmd(args: Args, tmp_path: Path):
         + "> /dev/null "
     )
     assert cmd == expected_cmd and parallel_cmds_file.is_file()
-
-
-def test_run_parallel_cmd(args: Args, tmp_path: Path):
-    """test run_parallel_cmd"""
-    cmd_list = ["echo 1", "echo 2", "echo 3"]
-    testdir = tmp_path / "test"
-    testdir.mkdir()
-    parallel_cmds_file = testdir / "parallel_cmds.txt"
-    parallel_log_file = testdir / "parallel_log.csv"
-    Cmd(args).run_parallel_cmd(cmd_list, parallel_cmds_file, parallel_log_file)
-    assert not parallel_cmds_file.is_file() and parallel_log_file.is_file()