Skip to content

Commit 635d4e8

Browse files
committed
feat: Use new Codecov uploader
1 parent b215992 commit 635d4e8

21 files changed

+45362
-3781
lines changed

Diff for: .eslintrc.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"es2021": true
66
},
77
"extends": [
8-
"google"
8+
"google",
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended"
911
],
1012
"parser": "@typescript-eslint/parser",
1113
"parserOptions": {
@@ -15,5 +17,6 @@
1517
"@typescript-eslint"
1618
],
1719
"rules": {
20+
"linebreak-style": 0
1821
}
1922
}

Diff for: .github/workflows/main.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: Workflow for Codecov Action
22
on: [push, pull_request]
33
jobs:
44
run:
5-
runs-on: ubuntu-latest
5+
runs-on: ${{ matrix.os }}
6+
strategy:
7+
matrix:
8+
os: [macos-latest, windows-latest, ubuntu-latest]
69
steps:
710
- name: Checkout
811
uses: actions/checkout@v2
@@ -12,16 +15,16 @@ jobs:
1215
run: npm run lint
1316
- name: Run tests and collect coverage
1417
run: npm run test
18+
- name: Upload coverage to Codecov (script)
19+
uses: ./
20+
with:
21+
files: ./coverage/script/coverage-final.json
22+
flags: script,${{ matrix.os }}
23+
name: codecov-script
1524
- name: Upload coverage to Codecov (demo)
1625
uses: ./
1726
with:
1827
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
1928
file: ./coverage/coverage-final.json
20-
flags: demo
29+
flags: demo,${{ matrix.os }}
2130
name: codecov-demo
22-
- name: Upload coverage to Codecov (script)
23-
uses: ./
24-
with:
25-
files: ./coverage/script/coverage-final.json
26-
flags: script
27-
name: codecov-script

Diff for: CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 2.0.0
2+
On February 1, 2022, the `v1` uploader will be full sunset and no longer function. This is due
3+
to the deprecation of the underlying bash uploader. This version uses the new [uploader](https://github.com/codecov/uploader).
4+
5+
The `v2` Action downloads, verifies, and runs the Codecov binary.
6+
7+
### Breaking Changes
8+
- Multiple fields have not been transferred from the bash uploader or have been deprecated. Notably
9+
many of the `functionalities` and `gcov_` arguments have been removed. Please check the documentation
10+
for the full list.
11+
12+
### Features
13+
- `dry-run` argument allows Codecov flow without uploading reports to Codecov
14+
- (Enterprise only) `slug` allows specifying the repository slug manually
15+
- (Enterprise only) `url` allows changing the upload host
16+
117
## 1.5.2
218
### Fixes
319
- # fix: Import version properly as string not object

Diff for: CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
:tada: Thanks for taking the time to contribute! :tada:
44

5-
The following is a set of guidelines for contributing to this repository, which is hosted in the [Codecov Organization](https://github.com/codecov) on GitHub.
5+
The following is a set of guidelines for contributing to this repository, which is hosted in the [Codecov Organization](https://github.com/codecov) on GitHub.
66

77
## What does this repo do?
88

9-
This repo is a GitHub Action, meaning it integrates with the GitHub Actions CI/CD pipeline. It's meant to take formatted reports with code coverage stats and upload them to codecov.io. Our Node action uses the Actions toolkit to make system calls that allow us to run Codecov's bash uploader inside of Node. Essentially what we're doing in this action is downloading Codecov's bash uploader script from codecov.io/bash, saving it as a file in the current directory, executing the file via `exec` calls, then removing the script from the current directory.
9+
This repo is a GitHub Action, meaning it integrates with the GitHub Actions CI/CD pipeline. It's meant to take formatted reports with code coverage stats and upload them to codecov.io. Our Node action uses the Actions toolkit to make system calls that allow us to run Codecov's bash uploader inside of Node. Essentially what we're doing in this action is downloading Codecov's bash uploader script from codecov.io/bash, saving it as a file in the current directory, executing the file via `exec` calls, then removing the script from the current directory.
1010

1111
## PRs, Issues, and Support
1212

13-
Feel free to clone, modify code and request a PR to this repository. All PRs and issues will be reviewed by the Codecov team. If your PR/issue has been sitting for a while or if you have any questions, ping us at [email protected]
13+
Feel free to clone, modify code and request a PR to this repository. All PRs and issues will be reviewed by the Codecov team. If your PR/issue has been sitting for a while or if you have any questions, ping us at [email protected]

Diff for: README.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@
77

88
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
99
10+
## ⚠️ Deprecration of v1
11+
**On February 1, 2022, this version will be fully sunset and no longer function**
12+
13+
Due to the [deprecation](https://about.codecov.io/blog/introducting-codecovs-new-uploader/) of the underlying bash uploader,
14+
the Codecov GitHub Action has released `v2` which will use the new [uploader](https://github.com/codecov/uploader). You can learn
15+
more about our deprecation plan and the new uploader on our [blog](https://about.codecov.io/blog/introducing-codecovs-new-uploader/).
16+
17+
We will be restricting any updates to the `v1` Action to security updates and hotfixes.
18+
19+
### Migration from `v1` to `v2`
20+
The `v2` uploader has a few breaking changes for users
21+
- Multiple fields have not been transferred from the bash uploader or have been deprecated. Notably
22+
many of the `functionalities` and `gcov_` arguments have been removed. Please check the documentation
23+
below for the full list.
24+
1025
## Usage
1126

12-
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v1` is recommended) as a `step` within your `workflow.yml` file.
27+
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v2` is recommended) as a `step` within your `workflow.yml` file.
1328

1429
If you have a *private repository*, this Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, store it as a `secret`). Optionally, you can choose to include up to four additional inputs to customize the upload context. **For public repositories, no token is needed**
1530

@@ -18,7 +33,7 @@ Inside your `.github/workflows/workflow.yml` file:
1833
```yaml
1934
steps:
2035
- uses: actions/checkout@master
21-
- uses: codecov/codecov-action@v1
36+
- uses: codecov/codecov-action@v2
2237
with:
2338
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
2439
files: ./coverage1.xml,./coverage2.xml # optional
@@ -38,29 +53,14 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
3853
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
3954
| `files` | Comma-separated paths to the coverage report(s) | Optional
4055
| `directory` | Directory to search for coverage reports. | Optional
56+
| `dry_run` | Don't upload files to Codecov | Optional
4157
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
4258
| | |
43-
| `aws_curl_args` | Extra curl arguments to communicate with AWS. | Optional
44-
| `codecov_curl_args` | Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy" | Optional
4559
| `commit_parent` | The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit. | Optional
4660
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
4761
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
48-
| `functionalities` | Toggle functionalities | Optional
49-
| | `coveragepy` Disable python coverage |
50-
| | `fix` Disable report fixing |
51-
| | `gcov` Disable gcov |
52-
| | `gcovout` Disable gcov output |
53-
| | `html` Enable coverage for HTML files |
54-
| | `network` Disable uploading the file network |
55-
| | `recursesubs` Enable recurse submodules in git projects when searching for source files | |
56-
| | `search` Disable searching for reports |
57-
| | `xcode` Disable xcode processing |
58-
| `gcov_path_include` | Paths to include during gcov gathering (as a glob) | Optional
59-
| `gcov_args` | extra arguments to pass to gcov | Optional
60-
| `gcov_executable` | gcov executable to run. Defaults to 'gcov' | Optional
61-
| `gcov_path_exclude` | Paths to ignore during gcov gathering (as a glob) | Optional
62-
| `gcov_prefix` | Prefix filepaths to help resolve path fixing | Optional
63-
| `gcov_root_dir` | Project root directory, also used when preparing gcov | Optional
62+
-| `functionalities` | Toggle functionalities | Optional
63+
-| | `network` Disable uploading the file network |
6464
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
6565
| `name` | Custom defined name for the upload | Optional
6666
| `override_branch` | Specify the branch name | Optional
@@ -70,10 +70,10 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
7070
| `override_tag` | Specify the git tag | Optional
7171
| `path_to_write_report` | Write upload file to path before uploading | Optional
7272
| `root_dir` | Used when not in git/hg project to identify project root directory | Optional
73+
| `slug` | Specify the slug manually (Enterprise use) | Optional
74+
| `url` | Change the upload host (Enterprise use) | Optional
7375
| `verbose` | Specify whether the Codecov output should be verbose | Optional
7476
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
75-
| `xcode_derived_data` | Custom Derived Data Path for Coverage.profdata and gcov processing | Optional
76-
| `xcode_package` | Specify packages to build coverage. Uploader will only build these packages. This can significantly reduces time to build coverage reports. -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" | Optional
7777

7878
### Example `workflow.yml` with Codecov Action
7979

@@ -101,15 +101,15 @@ jobs:
101101
pip install pytest-cov
102102
pytest --cov=./ --cov-report=xml
103103
- name: Upload coverage to Codecov
104-
uses: codecov/codecov-action@v1
104+
uses: codecov/codecov-action@v2
105105
with:
106106
token: ${{ secrets.CODECOV_TOKEN }}
107-
files: ./coverage1.xml,./coverage2.xml
108107
directory: ./coverage/reports/
109-
flags: unittests
110108
env_vars: OS,PYTHON
111-
name: codecov-umbrella
112109
fail_ci_if_error: true
110+
files: ./coverage1.xml,./coverage2.xml
111+
flags: unittests
112+
name: codecov-umbrella
113113
path_to_write_report: ./coverage/codecov_report.txt
114114
verbose: true
115115
```

Diff for: action.yml

+9-36
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ inputs:
1414
flags:
1515
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
1616
required: false
17-
aws_curl_args:
18-
description: 'Extra curl arguments to communicate with AWS.'
19-
required: false
20-
codecov_curl_args:
21-
description: 'Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy"'
22-
required: false
2317
commit_parent:
2418
description: 'The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository providers API, the parent is determined via finding the closest ancestor to the commit.'
2519
required: false
20+
dry_run:
21+
description: "Don't upload files to Codecov"
22+
required: false
2623
env_vars:
2724
description: 'Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)'
2825
required: false
@@ -35,33 +32,12 @@ inputs:
3532
functionalities:
3633
description: 'Comma-separated list, see the README for options and their usage'
3734
required: false
38-
gcov_args:
39-
description: 'extra arguments to pass to gcov'
40-
required: false
41-
gcov_executable:
42-
description: 'gcov executable to run. Defaults to gcov'
43-
required: false
44-
gcov_path_exclude:
45-
description: 'Paths to ignore during gcov gathering (as a glob)'
46-
required: false
47-
gcov_path_include:
48-
description: 'Paths to include during gcov gathering (as a glob)'
49-
required: false
50-
gcov_prefix:
51-
description: 'Prefix filepaths to help resolve path fixing'
52-
required: false
53-
gcov_root_dir:
54-
description: 'Project root directory, also used when preparing gcov'
55-
required: false
5635
move_coverage_to_trash:
5736
description: 'Move discovered coverage reports to the trash'
5837
required: false
5938
name:
6039
description: 'User defined upload name. Visible in Codecov UI'
6140
required: false
62-
network_filter:
63-
description: 'Used to restrict the set of git/hg files that can be matched with filenames in the coverage report. This is useful for monorepos or other setups where a full filepath may not be specified in the coverage report, and that shortened filepath may appear multiple times in a directory structure (e.g. __init__.py)'
64-
required: false
6541
override_branch:
6642
description: 'Specify the branch name'
6743
required: false
@@ -77,24 +53,21 @@ inputs:
7753
override_tag:
7854
description: 'Specify the git tag'
7955
required: false
80-
path_to_write_report:
81-
description: 'Write upload file to path before uploading'
82-
required: false
8356
root_dir:
8457
description: 'Used when not in git/hg project to identify project root directory'
8558
required: false
59+
slug:
60+
description: 'Specify the slug manually (Enterprise use)'
61+
required: false
62+
url:
63+
description: 'Change the upload host (Enterprise use)'
64+
required: false
8665
verbose:
8766
description: 'Specify whether the Codecov output should be verbose'
8867
required: false
8968
working-directory:
9069
description: 'Directory in which to execute codecov.sh'
9170
required: false
92-
xcode_derived_data:
93-
description: 'Custom Derived Data Path for Coverage.profdata and gcov processing'
94-
required: false
95-
xcode_package:
96-
description: 'Specify packages to build coverage. Uploader will only build these packages'
97-
required: false
9871
branding:
9972
color: 'red'
10073
icon: 'umbrella'

0 commit comments

Comments
 (0)