Repository: SPFlow/SPFlow (language: python)

Issue:
Add Codecov bot
Does it make sense to add the codecov bot? https://github.com/apps/codecov

@felixdivo do you have any experience with this in terms of helpfulness?


Discussion / hints:
I think it is a useful thing to have. It creates a bit of noise though, since it comments ont the PR. I guess it's worth it. 🤷
As it is assigned to me, shall I add it?
Yep, feel free if you find time for it 🙂 

Fix patch:
diff --git a/.github/workflows/github-actions-build-python.yaml b/.github/workflows/github-actions-build-python.yaml
index faee22483..c316cea41 100644
--- a/.github/workflows/github-actions-build-python.yaml
+++ b/.github/workflows/github-actions-build-python.yaml
@@ -68,6 +68,7 @@ jobs:
       - uses: "./.github/actions/run_tests"
         with:
           version-python: ${{ matrix.version-python }}
+          codecov-token: ${{ secrets.CODECOV_TOKEN }}
 
   "Test_Numpy":
     name: "Test: Py ${{ matrix.version-python }} + Numpy ${{ matrix.version-numpy }}"
@@ -84,6 +85,7 @@ jobs:
         with:
           version-python: ${{ matrix.version-python }}
           version-numpy: ${{ matrix.version-numpy }}
+          codecov-token: ${{ secrets.CODECOV_TOKEN }}
 
   "Test_Torch":
     name: "Test: Py ${{ matrix.version-python }} + Torch ${{ matrix.version-pytorch }}"
@@ -103,6 +105,7 @@ jobs:
         with:
           version-python: ${{ matrix.version-python }}
           version-pytorch: ${{ matrix.version-pytorch }}
+          codecov-token: ${{ secrets.CODECOV_TOKEN }}
 
   "Test_Jax":
     name: "Test: Py ${{ matrix.version-python }} + Jax ${{ matrix.version-jax }}"
@@ -119,3 +122,4 @@ jobs:
         with:
           version-python: ${{ matrix.version-python }}
           version-jax: ${{ matrix.version-jax }}
+          codecov-token: ${{ secrets.CODECOV_TOKEN }}


Test patch:
diff --git a/.github/actions/run_tests/action.yaml b/.github/actions/run_tests/action.yaml
index c07ee1871..6aa36bb81 100644
--- a/.github/actions/run_tests/action.yaml
+++ b/.github/actions/run_tests/action.yaml
@@ -12,6 +12,10 @@ inputs:
   version-jax:
     required: false
 
+  # We cannot access the secrets in the composite action, so we have to pass it as an input
+  codecov-token:
+    required: true
+
 runs:
   using: 'composite'
   steps:
@@ -50,3 +54,8 @@ runs:
       shell: bash
       run: |
         SPFLOW_TEST_BACKEND=${{ matrix.test-backend }} pytest --cov=spflow tests
+
+    - name: Upload coverage reports to Codecov
+      uses: codecov/codecov-action@v3
+      env:
+        CODECOV_TOKEN: ${{ matrix.codecov-token }}