Repository: censusdis/divintseg (language: python)

Issue:
License and metadata.



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml
index 4f55cb6..5374cab 100644
--- a/.github/workflows/coverage-report.yml
+++ b/.github/workflows/coverage-report.yml
@@ -4,6 +4,7 @@ on:
   push:
     branches-ignore:
       - main
+  workflow_dispatch:
 
 jobs:
   test:
@@ -13,10 +14,12 @@ jobs:
       #       check-out repo and set-up python
       #----------------------------------------------
       - name: Check out repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
+        with:
+          ssh-key: ${{secrets.DEPLOY_ACTION_SECRET}}
       - name: Set up python
         id: setup-python
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: 3.9
       #----------------------------------------------
@@ -34,7 +37,7 @@ jobs:
       #----------------------------------------------
       - name: Load cached venv
         id: cached-poetry-dependencies
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: .venv
           key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
@@ -68,15 +71,6 @@ jobs:
           genbadge coverage -n coverage -o ./reports/coverage/coverage-badge.svg
           genbadge tests --name tests -i reports/junit/junit.xml -o ./reports/junit/tests-badge.svg
       #----------------------------------------------
-      #              archive code coverage
-      #----------------------------------------------
-      - name: Archive code coverage
-        uses: actions/upload-artifact@v3
-        with:
-          name: test_artifacts
-          path: tests/_test_artifacts
-          retention-days: 7
-      #----------------------------------------------
       #              commit coverage
       #----------------------------------------------
       - name: Commit coverage reports and badge
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index ec82f6a..d01d375 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,6 +1,6 @@
 name: lint
 
-on: pull_request
+on: [pull_request, workflow_dispatch]
 
 jobs:
   linting:
@@ -9,12 +9,14 @@ jobs:
       #----------------------------------------------
       #       check-out repo and set-up python
       #----------------------------------------------
-      - uses: actions/checkout@v2
-      - uses: actions/setup-python@v2
+      - uses: actions/checkout@v3
+      - uses: actions/setup-python@v4
+        with:
+          python-version: 3.9
       #----------------------------------------------
       #        load pip cache if cache exists
       #----------------------------------------------
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.cache/pip
           key: ${{ runner.os }}-pip


Test patch:
diff --git a/.github/workflows/matrix-test.yml b/.github/workflows/matrix-test.yml
new file mode 100644
index 0000000..e738526
--- /dev/null
+++ b/.github/workflows/matrix-test.yml
@@ -0,0 +1,48 @@
+# Run a matrix of tests across different platforms and python versions.
+# This is run on each pull request so we get a complete picture of any
+# platform-specific issues not caught earlier.
+
+# Based on https://github.com/vengroff/censusdis/tree/main/.github/workflows
+
+name: test-matrix
+
+on: [pull_request, workflow_dispatch]
+
+jobs:
+  test-matrix:
+    strategy:
+      matrix:
+        python-version: ["3.9", "3.10", "3.11"]
+        os: ["ubuntu-latest", "macos-latest", "windows-latest"]
+      fail-fast: false
+    defaults:
+      run:
+        shell: bash
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Check out repository
+        uses: actions/checkout@v3
+      - name: Set up python
+        id: setup-python
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install Poetry
+        uses: snok/install-poetry@v1
+        with:
+          virtualenvs-create: true
+          virtualenvs-in-project: true
+      - name: Load cached venv
+        id: cached-pip-wheels
+        uses: actions/cache@v3
+        with:
+          path: ~/.cache
+          key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
+      - name: Install dependencies
+        run: poetry install --no-interaction --no-root
+      - name: Install library
+        run: poetry install --no-interaction
+      - name: Run tests
+        run: |
+          source $VENV
+          pytest
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
new file mode 100644
index 0000000..270f41b
--- /dev/null
+++ b/.github/workflows/unit-test.yml
@@ -0,0 +1,68 @@
+# Run unit tests every time a branch is pushed. This is the simplest
+# version of unit testing, just on a single platform.
+
+# Based on https://github.com/vengroff/censusdis/tree/main/.github/workflows
+
+name: unit-test
+
+on:
+  push:
+    branches-ignore:
+      - main
+  workflow_dispatch:
+
+jobs:
+  unit-test:
+    runs-on: ubuntu-latest
+    steps:
+      #----------------------------------------------
+      #       check out repo
+      #----------------------------------------------
+      - name: Check out repository
+        uses: actions/checkout@v3
+      #----------------------------------------------
+      #       set up python
+      #----------------------------------------------
+      - name: Set up python
+        id: setup-python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.9
+      #----------------------------------------------
+      #  -----  install & configure poetry  -----
+      #----------------------------------------------
+      - name: Install Poetry
+        uses: snok/install-poetry@v1
+        with:
+          virtualenvs-create: true
+          virtualenvs-in-project: true
+          installer-parallel: true
+
+      #----------------------------------------------
+      #       load cached venv if cache exists
+      #----------------------------------------------
+      - name: Load cached venv
+        id: cached-poetry-dependencies
+        uses: actions/cache@v3
+        with:
+          path: .venv
+          key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
+      #----------------------------------------------
+      # install dependencies if cache does not exist
+      #----------------------------------------------
+      - name: Install dependencies
+        if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
+        run: poetry install --no-interaction --no-root
+      #----------------------------------------------
+      # install your root project, if required
+      #----------------------------------------------
+      - name: Install library
+        run: poetry install --no-interaction
+      #----------------------------------------------
+      #              run test suite
+      #----------------------------------------------
+      - name: Run tests
+        id: runTests
+        run: |
+          source .venv/bin/activate
+          python -m pytest