Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use_python option #1672

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,7 @@ for the full list.
- #166 Bump requestretry from 4.1.1 to 4.1.2
- #169 Bump typescript from 4.0.5 to 4.1.2
- #178 Bump @types/jest from 26.0.15 to 26.0.19

## 5.0.3
### Features
- Added an option to use Python to run `codecov-cli` in `action.yml` by introducing a new input `use_python`.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ steps:
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
use_python: true # optional (default = false)
```

The Codecov token can also be passed in via environment variables:
Expand All @@ -82,6 +83,7 @@ steps:
flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)
use_python: true # optional (default = false)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
```
Expand Down Expand Up @@ -138,6 +140,7 @@ Codecov's Action supports inputs from the user. These inputs, along with their d
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `version` | Specify which version of the Codecov CLI should be used. Defaults to `latest` | Optional
| `working-directory` | Directory in which to execute codecov.sh | Optional
| `use_python` | Use Python to run codecov-cli instead of binary | Optional

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

Expand Down Expand Up @@ -175,6 +178,7 @@ jobs:
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
use_python: true
```
## Contributing

Expand Down
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ inputs:
working-directory:
description: 'Directory in which to execute codecov.sh'
required: false
use_python:
description: 'Use Python to run codecov-cli instead of binary'
required: false
default: 'false'

branding:
color: 'red'
Expand Down Expand Up @@ -215,6 +219,12 @@ runs:
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}

- name: Install codecov-cli using Python
if: ${{ inputs.use_python == 'true' }}
shell: bash
run: |
pip install codecov-cli

- name: Upload coverage to Codecov
run: ${GITHUB_ACTION_PATH}/dist/codecov.sh
shell: bash
Expand Down Expand Up @@ -256,3 +266,4 @@ runs:
CC_VERBOSE: ${{ inputs.verbose }}
CC_VERSION: ${{ inputs.version }}
CC_YML_PATH: ${{ inputs.codecov_yml_path }}
CC_USE_PYTHON: ${{ inputs.use_python }}