File tree Expand file tree Collapse file tree 4 files changed +37
-16
lines changed Expand file tree Collapse file tree 4 files changed +37
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ jobs:
137
137
- name : Prepare coverage token
138
138
if : success() && !matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' )
139
139
run : |
140
- cp .github/codecov-upstream.yml codecov.yml
140
+ python scripts/append_codecov_token.py
141
141
142
142
- name : Combine coverage
143
143
if : success() && !matrix.skip_coverage
Original file line number Diff line number Diff line change 1
- # note: `.github/codecov-upstream.yml` is basically a copy of this file, please propagate
2
- # changes as needed
3
1
coverage :
4
2
status :
5
3
project : true
Original file line number Diff line number Diff line change
1
+ """
2
+ Appends the codecov token to the 'codecov.yml' file at the root of the repository.
3
+
4
+ This is done by CI during PRs and builds on the pytest-dev repository so we can upload coverage, at least
5
+ until codecov grows some native integration like it has with Travis and AppVeyor.
6
+
7
+ See discussion in https://github.com/pytest-dev/pytest/pull/6441 for more information.
8
+ """
9
+ import os .path
10
+ from textwrap import dedent
11
+
12
+
13
+ def main ():
14
+ this_dir = os .path .dirname (__file__ )
15
+ cov_file = os .path .join (this_dir , ".." , "codecov.yml" )
16
+
17
+ assert os .path .isfile (cov_file ), "{cov_file} does not exist" .format (
18
+ cov_file = cov_file
19
+ )
20
+
21
+ with open (cov_file , "a" ) as f :
22
+ # token from: https://codecov.io/gh/pytest-dev/pytest/settings
23
+ # use same URL to regenerate it if needed
24
+ text = dedent (
25
+ """
26
+ codecov:
27
+ token: "1eca3b1f-31a2-4fb8-a8c3-138b441b50a7"
28
+ """
29
+ )
30
+ f .write (text )
31
+
32
+ print ("Token updated:" , cov_file )
33
+
34
+
35
+ if __name__ == "__main__" :
36
+ main ()
You can’t perform that action at this time.
0 commit comments