You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CodecovCLI is a new way for users to interact with Codecov directly from the user’s terminal or CI platform. Many Codecov features that require the user’s interference can be done via the codecovCLI. It saves commits, creates reports, uploads coverage and has many more amazing features.
6
+
1
7
-[Installing](#installing)
2
-
-[Running the upload command](#running-the-upload-command)
3
-
-[Running other commands](#running-other-commands)
8
+
-[Usage](#usage)
9
+
-[Codecov-cli Commands](#codecov-cli-commands)
10
+
-[create-commit](#create-commit)
11
+
-[create-report](#create-report)
12
+
-[do-upload](#do-upload)
13
+
-[create-report-results](#create-report-results)
14
+
-[get-report-results](#get-report-results)
15
+
-[pr-base-picking](#pr-base-picking)
16
+
-[How to upload to Codecov](#how-to-upload-to-codecov)
17
+
-[How to Local upload](#how-to-local-upload)
4
18
-[Plugin System](#plugin-system)
5
-
-[Development](#development)
19
+
-[Contributions](#contributions)
6
20
-[Requirements](#requirements)
7
21
-[Guidelines](#guidelines)
8
22
-[Releases](#releases)
9
23
10
24
# Installing
11
25
12
-
To install this package locally, you can run
26
+
To use codecov-cli in your local machine, or your CI workflows, you need to install it
13
27
14
-
`python setup.py develop`
28
+
`pip install codecov-cli`
15
29
16
-
If you are installing from somewhere else, you can add:
30
+
The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewed [here]().
31
+
You can also find Codecovcli [here](https://cli.codecov.io/) or in the [Github releases](https://github.com/codecov/codecov-cli/releases) where you can download the binary distributable files.
17
32
33
+
# Usage
34
+
If the installation is successful, running `codecovcli --help` will output the available commands along with the different general options that can be used with them.
| `--verbose` or `-v` | Run the cli with verbose logging | Optional
47
+
48
+
# Codecov-cli Commands
49
+
| Command | Description |
50
+
| :---: | :---: |
51
+
| `create-commit` | Saves the commit's metadata in codecov, only need to do it once for a commit
52
+
| `create-report` | Creates an empty report in codecov with initial data e.g. report name, report's commit
53
+
| `do-upload` | Searches for and uploads coverage data to codecov
54
+
| `create-report-results` | Used for local upload. It tells codecov that you finished local uploading and want it to calculate the results for you to get them locally.
55
+
| `get-report-results` | Used for local upload. It asks codecov to provide you the report results you calculated with the previous command.
56
+
| `pr-base-picking` | Tells codecov that you want to explicitly define a base for your PR
57
+
58
+
>**Note**: Every command has its own different options that will be mentioned later in this doc. Codecov will try to load these options from your CI environment variables, if not, it will try to load them from git, if not found, you may need to add them manually.
|--code| The code of the report. This is used in local uploading to isolate local reports from regular or cloud reports uploaded to codecov so they don't get merged. It's basically a name you give to your report e.g. local-report. | Optional
You can customize the commands with the options aligned with each command.
31
162
32
-
and pass parameters as you see fit. You can get help on
33
-
163
+
# How to Local upload:
164
+
If you CI workflow takes too much time to run, and you have to wait for it to finish to know the coverage results, you can make your changes locally, make a PR and then run these commands:
34
165
```
35
-
codecovcli --help
166
+
pip install codecovcli
167
+
codecovcli create-commit
168
+
codecovcli create-report --code <CODE>
169
+
codecovcli do-upload --report-code <CODE>
170
+
codecovcli create-report-results --code <CODE>
171
+
codecovcli get-report-results --code <CODE>
36
172
```
37
173
38
-
and
174
+
Codecov will calculate the coverage results, and return them in your terminal, telling you whether your PR will fail or pass the coverage check.
39
175
40
-
```
41
-
codecovcli do-upload --help
42
-
```
43
-
44
-
# Running other commands
45
-
46
-
There are many nested commands here.
47
176
48
177
# Plugin System
49
178
50
179
In some of the commands, there is a plugin system. For most cases, one might find that changing them is not really needed. But in some cases, have some custom logic run would be beneficial
51
180
181
+
52
182
WIP
53
183
54
-
# Development
184
+
# Contributions
55
185
56
186
## Requirements
57
187
@@ -62,8 +192,13 @@ Before installing, one should pull the submodules with
62
192
```
63
193
git submodule update --init
64
194
```
195
+
Then, install dependencies with
196
+
```
197
+
pip install -r requirements.txt
198
+
python setup.py develop
199
+
```
65
200
66
-
The c code shouldn't require anything on most places, but it might ask you to install compilers and stuff. Most of the times you can find the instructions online given the error messsage
201
+
The c code shouldn't require anything in most places, but it might ask you to install compilers and stuff. Most of the times you can find the instructions online given the error message
67
202
68
203
## Guidelines
69
204
@@ -75,11 +210,15 @@ There are a few guidelines when developing in this systems. We have a few notabl
75
210
76
211
# Releases
77
212
78
-
The standard way to making a new release is to get the up-to-date master branch locally and run the `tag.release` command from the Makefile.
213
+
The standard way to making a new release is the following:
214
+
1) Open a PR that increases the version number in setup.py. As a rule of thumb, just add one to the micro version (number most to the right).
79
215
80
-
`$ make tag.release version=v0.1.1`
216
+
2) Get the up-to-date master branch locally and run the `tag.release` command from the Makefile.
217
+
218
+
`$ make tag.release version=v<VERSION_NUM>`
81
219
82
220
The version tag must match the regex defined on the Makefile (`tag_regex := ^v([0-9]{1,}\.){2}[0-9]{1,}([-_]\w+)?$`).
83
-
Also keep in mind:
84
-
* Releases with `test` word in them are created as `draft`
85
-
* Releases with `beta` work in them are created as `pre-release`
221
+
222
+
>**Note**: \
223
+
>Releases with `test` word in them are created as `draft`. \
224
+
>Releases with `beta` work in them are created as `pre-release`.
0 commit comments