Repository: simonsobs/ocs (language: python)

Issue:
Setup coverage reporting on codecov.io
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
This PR sets up code coverage reporting on codecov.io. Before merging it might even remove coverage reporting to coveralls.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
We've been using coveralls.io for a while now, but I often find the coverage reports are extremely slow to navigate, taking 10's of seconds or longer to expand directories/load source files. I'd like to migrate away to codecov.io for this reason alone, but codecov has some additional nice features that I find appealing. codecov is also used by several other repos in our organization.

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->
I've migrated [sorunlib](https://github.com/simonsobs/sorunlib) to codecov already, so this is based on that.

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] Repository infrastructure change

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.

Setup coverage reporting on codecov.io
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
This PR sets up code coverage reporting on codecov.io. Before merging it might even remove coverage reporting to coveralls.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
We've been using coveralls.io for a while now, but I often find the coverage reports are extremely slow to navigate, taking 10's of seconds or longer to expand directories/load source files. I'd like to migrate away to codecov.io for this reason alone, but codecov has some additional nice features that I find appealing. codecov is also used by several other repos in our organization.

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->
I've migrated [sorunlib](https://github.com/simonsobs/sorunlib) to codecov already, so this is based on that.

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] Repository infrastructure change

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.



Discussion / hints:
For reports to start working this needs to be merged. Replacement of coveralls will come in a follow-up PR.
For reports to start working this needs to be merged. Replacement of coveralls will come in a follow-up PR.

Fix patch:
diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644
index 00000000..1672af41
--- /dev/null
+++ b/.github/codecov.yml
@@ -0,0 +1,20 @@
+---
+codecov:
+  branch: main
+
+# https://docs.codecov.com/docs/pull-request-comments#disable-comment
+comment: false
+
+# https://docs.codecov.com/docs/commit-status
+coverage:
+  status:
+    project:
+      default:
+        target: auto
+        threshold: 3
+        paths:
+          - "ocs/"
+    patch: false
+
+# When modifying this file, please validate using
+# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
diff --git a/README.rst b/README.rst
index 56e644da..13bd92f6 100644
--- a/README.rst
+++ b/README.rst
@@ -141,8 +141,8 @@ This project is licensed under the BSD 2-Clause License - see the
 .. _LICENSE.txt: https://github.com/simonsobs/ocs/blob/main/LICENSE.txt
 
 
-.. |coverage| image:: https://coveralls.io/repos/github/simonsobs/ocs/badge.svg
-    :target: https://coveralls.io/github/simonsobs/ocs
+.. |coverage| image:: https://codecov.io/gh/simonsobs/ocs/graph/badge.svg?token=UTX0AEPTX8
+    :target: https://codecov.io/gh/simonsobs/ocs
 
 .. |docker| image:: https://img.shields.io/badge/dockerhub-latest-blue
     :target: https://hub.docker.com/r/simonsobs/ocs/tags


Test patch:
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
index 5f41e3ea..7306d287 100644
--- a/.github/workflows/pytest.yml
+++ b/.github/workflows/pytest.yml
@@ -57,15 +57,11 @@ jobs:
 
     # Coverage
     - name: Report test coverage
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       run: |
         mv ./tests/.coverage.* ./
-        pip install coveralls
         coverage combine
         coverage xml
         coverage report
-        coveralls --service=github
 
     - name: Upload results to Codecov
       uses: codecov/codecov-action@v4