From 0b08d161ef88c6096ed48b8531c2cc80ed69b32c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 14 Jan 2022 17:54:21 +0000 Subject: [PATCH 1/5] ci: prototype running lint / unit tests / coverage as GH actions --- .github/workflows/blacken.yml | 25 +++++++++++++ .github/workflows/docs.yml | 25 +++++++++++++ .github/workflows/lint.yml | 28 ++++++++++++++ .github/workflows/unittest.yml | 67 ++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 .github/workflows/blacken.yml create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/blacken.yml b/.github/workflows/blacken.yml new file mode 100644 index 0000000..5c485c7 --- /dev/null +++ b/.github/workflows/blacken.yml @@ -0,0 +1,25 @@ +name: "Blacken" + +on: + pull_request: + branches: + - main + +jobs: + run-blacken: + name: blacken + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run blacken + run: | + nox -s blacken diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..e46701c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,25 @@ +name: "Docs" + +on: + pull_request: + branches: + - main + +jobs: + run-docs: + name: docs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4fbcc0d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: "Lint" + +on: + pull_request: + branches: + - main + +jobs: + run-lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..22fbe6d --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,67 @@ +name: "Unit tests" + +on: + pull_request: + branches: + - main + +jobs: + run-unittests: + name: unit${{ matrix.option }}-${{ matrix.python }} + runs-on: ubuntu-latest + strategy: + matrix: + python: + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage${{ matrix.option }}-${{matrix.python }} + run: | + nox -s unit${{ matrix.option }}-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v2 + with: + name: coverage-artifacts + path: .coverage${{ matrix.option }}-${{ matrix.python }} + + report-coverage: + name: cover + runs-on: ubuntu-latest + needs: + - run-unittests + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=100 + From 64bfeefa386e36d6e3a0e8a0e34dc6d3c4c2b3a8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 14 Jan 2022 18:45:06 +0000 Subject: [PATCH 2/5] remove blacken check --- .github/workflows/blacken.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/blacken.yml diff --git a/.github/workflows/blacken.yml b/.github/workflows/blacken.yml deleted file mode 100644 index 5c485c7..0000000 --- a/.github/workflows/blacken.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "Blacken" - -on: - pull_request: - branches: - - main - -jobs: - run-blacken: - name: blacken - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Install nox - run: | - python -m pip install --upgrade setuptools pip wheel - python -m pip install nox - - name: Run blacken - run: | - nox -s blacken From b69165fe65be72ca1d1ac0b8e6092318f4e9a318 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 14 Jan 2022 18:48:54 +0000 Subject: [PATCH 3/5] add docfx session --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e46701c..1c1fb09 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,4 +22,4 @@ jobs: python -m pip install nox - name: Run docs run: | - nox -s docs + nox -s docs docfx From 6e32f945b34c5ed4d683783da265f723e533289a Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jan 2022 17:11:16 +0000 Subject: [PATCH 4/5] remove matrix.option --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 22fbe6d..3dae828 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -7,7 +7,7 @@ on: jobs: run-unittests: - name: unit${{ matrix.option }}-${{ matrix.python }} + name: unit-${{ matrix.python }} runs-on: ubuntu-latest strategy: matrix: From eade3dcc8b19792f8c8982ab983a62c4d9e055f1 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jan 2022 20:45:49 +0000 Subject: [PATCH 5/5] remove newline --- .github/workflows/unittest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 3dae828..873a8fb 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -64,4 +64,3 @@ jobs: run: | coverage combine .coverage-results/.coverage* coverage report --show-missing --fail-under=100 -