Repository: AI-SDC/SACRO-ML (language: python)

Issue:
pylint safemodel and report coverage

pylint safemodel and report coverage



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..1fd0327d
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,24 @@
+---
+name: lint
+
+on:
+  push:
+
+jobs:
+  build:
+    runs-on: ubuntu-22.04
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install pylint pytest pytest-cov
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+
+      - name: pylint
+        run: |
+          pylint safemodel **/*.py --fail-under 10
+...


Test patch:
diff --git a/.github/workflows/lint-test-on-push.yml b/.github/workflows/lint-test-on-push.yml
deleted file mode 100644
index a3cbe2ed..00000000
--- a/.github/workflows/lint-test-on-push.yml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-name: pylint and unit test
-
-on: [push]
-
-jobs:
-  build:
-
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        python-version: ["3.10"]
-
-    steps:
-      - uses: actions/checkout@v3
-      - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
-        with:
-          python-version: ${{ matrix.python-version }}
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install pylint pytest
-          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-      - name: Lint with pylint
-        run: |
-          pylint **/*.py --fail-under 10
-      - name: Test with pytest
-        run: |
-          pytest .
-...
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..96f839cb
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,27 @@
+---
+name: test
+
+on:
+  push:
+
+jobs:
+  build:
+    runs-on: ubuntu-22.04
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install pylint pytest pytest-cov
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+
+      - name: pytest and report coverage
+        run: |
+          pytest --cov=./ --cov-report=xml
+          curl -Os https://uploader.codecov.io/latest/linux/codecov
+          chmod +x codecov
+          ./codecov
+...