Skip to content

Commit d6923f4

Browse files
Update instance repo from cookiecutter template
1 parent 6cd6793 commit d6923f4

File tree

3 files changed

+13
-39
lines changed

3 files changed

+13
-39
lines changed

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
3-
"commit": "cd4676edc794359c10500cb4edfd98ce9fc2c2a3",
3+
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -36,7 +36,7 @@
3636
"trim_blocks": true
3737
},
3838
"_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
39-
"_commit": "cd4676edc794359c10500cb4edfd98ce9fc2c2a3"
39+
"_commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95"
4040
}
4141
},
4242
"directory": null

.github/workflows/test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
4747
test:
4848
needs: get-environments
49+
permissions:
50+
id-token: write # for codecov OIDC
4951

5052
strategy:
5153
fail-fast: false
@@ -82,6 +84,9 @@ jobs:
8284
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
8385
- name: Upload coverage
8486
uses: codecov/codecov-action@v5
87+
with:
88+
fail_ci_if_error: true
89+
use_oidc: true
8590

8691
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
8792
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.

docs/template_usage.md

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -86,52 +86,21 @@ line-length = 120
8686

8787
### Coverage tests with _Codecov_
8888

89-
Coverage tells what fraction of the code is "covered" by unit tests, thereby encouraging contributors to [write tests](contributing.md#writing-tests).
89+
Coverage tells what fraction of the code is "covered" by unit tests,
90+
thereby encouraging contributors to [write tests](contributing.md#writing-tests).
9091
To enable coverage checks, head over to [codecov][] and sign in with your GitHub account.
91-
You'll find more information in "getting started" section of the [codecov docs][].
92+
You'll find more information in "quick start" section of the [codecov docs][].
9293

93-
In the `Actions` tab of your projects' GitHub repository, you can see that the workflows are failing due to the **Upload coverage** step.
94-
The error message in the workflow should display something like:
95-
96-
```
97-
...
98-
Retrying 5/5 in 2s..
99-
{'detail': ErrorDetail(string='Could not find a repository, try using repo upload token', code='not_found')}
100-
Error: 404 Client Error: Not Found for url:
101-
...
102-
```
103-
104-
While [codecov docs][] has a very extensive documentation on how to get started,
105-
_if_ you are using the default settings of this template we can assume that you are using [codecov][] in a GitHub action workflow and hence you can make use of the [codecov bot][].
94+
Codecov uses [OpenID connect][] to authenticate, therefore, specifying a token should not be necessary.
10695

96+
If you want codecov to comment on pull requests, you can make use of the [codecov bot][].
10797
To set it up, simply go to the [codecov app][] page and follow the instructions to activate it for your repository.
108-
Once the activation is completed, go back to the `Actions` tab and re-run the failing workflows.
109-
110-
The workflows should now succeed, and you will be able to find the code coverage at this link:
111-
`https://app.codecov.io/gh/scverse/cookiecutter-scverse-instance`.
112-
You might have to wait a couple of minutes and the coverage of this repository should be ~60%.
113-
114-
If your repository is private, you will have to specify an additional token in the repository secrets.
115-
In brief, you need to:
116-
117-
1. Generate a Codecov Token by clicking _setup repo_ in the codecov dashboard.
118-
- If you have already set up codecov in the repository by following the previous steps, you can directly go to the codecov repo webpage.
119-
2. Go to _Settings_ and copy **only** the token `_______-____-...`.
120-
3. Go to _Settings_ of your newly created repository on GitHub.
121-
4. Go to _Security > Secrets > Actions_.
122-
5. Create new repository secret with name `CODECOV_TOKEN` and paste the token generated by codecov.
123-
6. Paste these additional lines in `/.github/workflows.test.yaml` under the **Upload coverage** step:
124-
```bash
125-
- name: Upload coverage
126-
uses: codecov/codecov-action@v3
127-
with:
128-
token: ${{ secrets.CODECOV_TOKEN }} ```
129-
7. Go back to GitHub `Actions` page an re-run previously failed jobs.
13098

13199
[codecov]: https://about.codecov.io/sign-up/
132100
[codecov app]: https://github.com/apps/codecov
133101
[codecov bot]: https://docs.codecov.com/docs/team-bot
134102
[codecov docs]: https://docs.codecov.com/docs
103+
[OpenID connect]: https://docs.github.com/en/actions/concepts/security/openid-connect
135104

136105
### Documentation on _readthedocs_
137106

0 commit comments

Comments
 (0)