Compare commits

..

118 Commits
v0.2 ... v1.0.3

Author SHA1 Message Date
Ibrahim Ali
d5749ba79a change token requirement to true 2019-10-17 12:32:14 -07:00
Ibrahim Ali
b4c0b83601 update docs to v1.0.3 2019-10-17 12:24:24 -07:00
Ibrahim Ali
3cde50f4f1 Update main.yml 2019-10-17 12:06:53 -07:00
Ibrahim Ali
10e590a5de Update main.yml 2019-10-17 12:04:46 -07:00
Ibrahim Ali
af19dcb193 Merge pull request #26 from teohhanhui/fix/shell-command-issues
Fix shell command issues
2019-10-17 11:56:14 -07:00
Teoh Han Hui
77e74f257f Fix shell command issues 2019-10-11 20:13:30 +02:00
Ibrahim Ali
1c4a4261fa update installation docs to latest MP version 2019-08-25 14:50:59 -07:00
Joe Becher
cb218a0977 Merge pull request #10 from codecov/drazisil-patch-1
install git and mercurial
2019-08-24 13:14:58 -04:00
Joe Becher
e78f79e460 install git and mercurial 2019-08-24 13:13:04 -04:00
Joe Becher
899e5c913e Merge pull request #9 from codecov/drazisil-patch-1
Repo now self-tests
2019-08-24 12:52:45 -04:00
Joe Becher
886c7c8bc8 Don't need sudo 2019-08-24 12:39:08 -04:00
Joe Becher
75d10d924b Install curl 2019-08-24 12:37:54 -04:00
Joe Becher
e61b738355 no need for apk 2019-08-24 12:36:15 -04:00
Joe Becher
cbad155b75 use ubuntu 2019-08-24 12:34:36 -04:00
Joe Becher
9e1c456662 Update main.yml 2019-08-24 12:32:59 -04:00
Joe Becher
392e5b2711 does this work? 2019-08-24 12:29:34 -04:00
Joe Becher
bd5538d84a add slash 2019-08-24 12:27:33 -04:00
Joe Becher
9d47efe7b9 local tests 2019-08-24 12:24:31 -04:00
Thomas Hu
6aa7ac1896 Merge pull request #8 from codecov/support-alpine
Update bash entrypoint
2019-08-24 11:38:00 -04:00
Thomas Hu
c2a68071b3 Update bash entrypoint 2019-08-24 11:29:05 -04:00
Ibrahim Ali
8273bebacc correct installation line org to codecov 2019-08-15 21:28:17 -07:00
Ibrahim Ali
6728012add add marketplace flag 2019-08-08 14:59:24 -07:00
Ibrahim Ali
e3f7b8baf8 Update README.md 2019-08-08 10:10:05 -07:00
“ibrahim0814”
4af6f0743e delete debug output 2019-08-08 09:42:59 -07:00
“ibrahim0814”
5c880506b5 env vars 2019-08-08 09:22:55 -07:00
“ibrahim0814”
a3a7edcc61 revert back to original 2019-08-08 09:21:49 -07:00
“ibrahim0814”
f93f6bdcae test env var 2019-08-08 08:39:08 -07:00
“ibrahim0814”
35b9267ca9 check what shows up for env 2019-08-08 08:24:15 -07:00
“ibrahim0814”
39a99a4e84 test ci env var 2019-08-08 08:19:32 -07:00
“ibrahim0814”
e0cc6d49d9 readme 2019-08-07 23:46:42 -07:00
“ibrahim0814”
96d1c9a15d readme 2019-08-07 23:44:17 -07:00
“ibrahim0814”
ee0d391ad0 clean up comments 2019-08-07 23:40:42 -07:00
“ibrahim0814”
bd3230c275 correct logic for token requirement 2019-08-07 23:00:45 -07:00
Ibrahim Ali
c7a04fdde5 Merge pull request #3 from codecov/thomasrockhu-patch-1
Better error message
2019-08-07 22:43:29 -07:00
Thomas Hu
efe83d2996 Revert "Remove options without a provided token"
This reverts commit db5a766c55.
2019-08-08 01:42:54 -04:00
Thomas Hu
db5a766c55 Remove options without a provided token
Remove options without a token
2019-08-08 01:39:13 -04:00
Thomas Hu
1f99174e83 Better error message 2019-08-08 01:36:45 -04:00
“ibrahim0814”
93d126a749 readme 2019-08-07 22:15:28 -07:00
“ibrahim0814”
4546e138ba readme 2019-08-07 21:47:36 -07:00
“ibrahim0814”
125cedf806 readme 2019-08-07 21:45:22 -07:00
“ibrahim0814”
6f489c7a78 readme 2019-08-07 21:44:55 -07:00
“ibrahim0814”
fc175be7b5 readme 2019-08-07 21:43:58 -07:00
“ibrahim0814”
a166a95c4a readme 2019-08-07 21:40:59 -07:00
“ibrahim0814”
dd94ace224 add contributing section 2019-08-07 21:38:13 -07:00
“ibrahim0814”
a8f7ad31ff readme 2019-08-07 21:33:14 -07:00
“ibrahim0814”
ed370e2ded readme 2019-08-07 21:30:18 -07:00
“ibrahim0814”
dd098b2f6b shift to token required 2019-08-07 21:20:10 -07:00
“ibrahim0814”
d2c4464978 readme 2019-08-07 21:03:14 -07:00
“ibrahim0814”
97fe500537 readme 2019-08-07 21:02:44 -07:00
“ibrahim0814”
111c74ca11 readme 2019-08-07 20:56:18 -07:00
“ibrahim0814”
edbb6f8e5d rem header comments 2019-08-07 20:41:31 -07:00
“ibrahim0814”
7d121a89c0 rem header comments 2019-08-07 20:40:25 -07:00
“ibrahim0814”
159fdf6e54 modify input description 2019-08-07 20:36:21 -07:00
“ibrahim0814”
4fb042f123 readme 2019-08-07 20:26:06 -07:00
“ibrahim0814”
0766dd1553 readme 2019-08-07 20:24:56 -07:00
“ibrahim0814”
e0683efc0b add header comments 2019-08-07 20:21:41 -07:00
“ibrahim0814”
1b38d5e8b4 readme 2019-08-07 20:10:44 -07:00
“ibrahim0814”
2793f27b99 readme 2019-08-07 20:07:45 -07:00
“ibrahim0814”
afda60d339 readme 2019-08-07 19:41:47 -07:00
“ibrahim0814”
f21e0e6d14 readme 2019-08-07 19:33:51 -07:00
“ibrahim0814”
55d06088fa readme 2019-08-07 19:29:56 -07:00
“ibrahim0814”
7461079497 readme 2019-08-07 19:29:11 -07:00
“ibrahim0814”
eda3e0f75c readme 2019-08-07 19:28:35 -07:00
“ibrahim0814”
c7f04ba6f0 readme 2019-08-07 19:27:57 -07:00
“ibrahim0814”
67896f6476 readme 2019-08-07 19:25:37 -07:00
“ibrahim0814”
1e6057f6d0 readme 2019-08-07 19:24:28 -07:00
“ibrahim0814”
25df614d11 readme 2019-08-07 19:23:31 -07:00
“ibrahim0814”
3ee0aad0bf readme 2019-08-07 19:18:32 -07:00
“ibrahim0814”
93ee40a7a2 readme 2019-08-07 19:17:51 -07:00
“ibrahim0814”
d1914c14b8 move arguments section up 2019-08-07 18:44:06 -07:00
“ibrahim0814”
c2703ce7b6 readme 2019-08-07 18:40:03 -07:00
“ibrahim0814”
47224ae4e6 readme 2019-08-07 18:38:52 -07:00
“ibrahim0814”
413e76629d add argument uage 2019-08-07 18:35:56 -07:00
“ibrahim0814”
6625b1305d add name documentation info 2019-08-07 18:30:01 -07:00
“ibrahim0814”
77578a4d61 remove debug statements 2019-08-07 18:21:36 -07:00
“ibrahim0814”
2ce8445bdf puts docker args back in 2019-08-07 18:16:19 -07:00
“ibrahim0814”
22e73b5938 empty args list 2019-08-07 18:14:12 -07:00
“ibrahim0814”
f338553518 test without args 2019-08-07 18:11:55 -07:00
“ibrahim0814”
2ca1146dfd test token arg 2019-08-07 18:09:32 -07:00
“ibrahim0814”
e49c256d4a try using no args 2019-08-07 18:05:04 -07:00
“ibrahim0814”
baf6a7af4f fix yml error try 2 2019-08-07 17:04:13 -07:00
“ibrahim0814”
d2db6055ff Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 16:45:37 -07:00
“ibrahim0814”
9aebf8f59e add name input with debug cmds 2019-08-07 16:42:40 -07:00
Ibrahim Ali
e74d307e33 Update README.md 2019-08-07 13:19:04 -07:00
Ibrahim Ali
55c9c61f7e Update README.md 2019-08-07 13:17:40 -07:00
“ibrahim0814”
e749576e48 Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 13:10:14 -07:00
“ibrahim0814”
4a87a38546 remove debug statements 2019-08-07 13:09:57 -07:00
Ibrahim Ali
d7c531ac59 add flags documentation 2019-08-07 13:08:23 -07:00
“ibrahim0814”
b8cc1b68aa add debug statements 2019-08-07 12:42:49 -07:00
“ibrahim0814”
1cb9bf4ff5 add flags 2019-08-07 12:34:25 -07:00
“ibrahim0814”
48bb5e4ec3 name, description edits 2019-08-07 12:09:55 -07:00
“ibrahim0814”
a4dba2e03e add documentation for file path 2019-08-07 12:01:44 -07:00
“ibrahim0814”
c1b452a1b8 manage file uploads 2019-08-07 11:49:18 -07:00
“ibrahim0814”
6905df41d5 correct conditionals 2019-08-07 11:44:00 -07:00
“ibrahim0814”
052454207d add debug echo statements 2019-08-07 11:41:02 -07:00
“ibrahim0814”
0be151486e add file conditionals 2019-08-07 11:39:29 -07:00
“ibrahim0814”
4b3f2da728 use default args 2019-08-07 11:18:32 -07:00
“ibrahim0814”
03b2817fb6 input at top 2019-08-07 11:15:48 -07:00
“ibrahim0814”
6fdf86f06b test null condition 2019-08-07 11:11:16 -07:00
“ibrahim0814”
7c7db8b859 file path test 2019-08-07 11:05:50 -07:00
“ibrahim0814”
044d93a92c Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 10:52:00 -07:00
“ibrahim0814”
caffaa27c7 add file path param 2019-08-07 10:51:41 -07:00
Ibrahim Ali
902f207325 delete improvements section 2019-08-07 10:21:52 -07:00
“ibrahim0814”
72a27786b2 readme 2019-08-07 08:14:31 -07:00
“ibrahim0814”
30fe6d4bec spelling 2019-08-07 08:13:13 -07:00
“ibrahim0814”
68ee090395 change email 2019-08-07 08:12:13 -07:00
“ibrahim0814”
ce00a5b662 readme 2019-08-07 08:10:22 -07:00
“ibrahim0814”
1f8bbdf5bb add pr section in contrib guide 2019-08-07 08:09:29 -07:00
“ibrahim0814”
47b142b183 add example workflow file 2019-08-07 07:59:10 -07:00
“ibrahim0814”
95bbe7b4bf add contributing guidelines 2019-08-07 07:38:37 -07:00
Ibrahim Ali
8e51ca4502 add license link 2019-08-07 06:40:15 -07:00
Ibrahim Ali
0fa1095987 Create LICENSE 2019-08-07 06:38:39 -07:00
Ibrahim Ali
02da153e67 Update README.md 2019-08-07 06:28:17 -07:00
“ibrahim0814”
125f8ba18b spelling fix 2019-08-07 06:17:19 -07:00
Ibrahim Ali
6a600290f3 correct name 2019-08-07 06:14:40 -07:00
“ibrahim0814”
839122bfbb Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 06:08:55 -07:00
“ibrahim0814”
3f456df687 del logo png 2019-08-07 06:08:32 -07:00
Ibrahim Ali
c465c373d0 Update README.md 2019-08-06 22:48:29 -07:00
8 changed files with 150 additions and 26 deletions

23
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Example workflow for Codecov
on: [push]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# - name: Setup Python
# uses: actions/setup-python@master
# - name: Generate coverage report
# run: |
# pip install pytest
# pip install pytest-cov
# pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: ./
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: unittest
name: codecov-1

13
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,13 @@
# Contribution Guide
:tada: Thanks for taking the time to contribute! :tada:
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.
## What does this repo do?
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. What's essentially happening in the background is that Actions is spinning up a Linux Docker container with the contents of this repository. Inside that container, we then call a shell scipt that runs Codecov's Bash uploader.
## PRs and Support
Feel free to clone, modify code and request a PR to this repository. All PRs will be reviewed by the Codecov team. If your PR has been sitting for a while or if you have any questions, ping us at support@codecov.io

View File

@@ -1,10 +1,15 @@
FROM alpine:3.10
# Codecov @codecov
WORKDIR /app
COPY . /app
FROM debian:stretch-slim
RUN apk add --no-cache curl bash git
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
git \
mercurial \
--no-install-recommends && rm -r /var/lib/apt/lists/*
RUN chmod +x /app/entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ]
ENTRYPOINT ["/entrypoint.sh"]

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Codecov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,28 +1,68 @@
<!-- <p align="center"><img src="./codecov-logo.png" /></p> -->
# Codecov GitHub Action
# Codecov Github Action
### Easily upload coverage reports to Codecov from Github Actions
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1.0.3-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
### Easily upload coverage reports to Codecov from GitHub Actions
## Usage
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number as a `step` within your `workflow.yml` file. 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 three additional inputs to customize the upload context.
Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v0.1
- uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
flags: unittests #optional
name: codecov-umbrella #optional
```
>**Note**: This assumes that you've set your Codecov token inside settings > secrets as `CODECOV_TOKEN`. If not, you can get an upload token for your specific repo on codecov.io. A token is not required for public repositories.
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io).
## Arguments
| Argument | Description |
| :---: | :---: |
| `token` | Used to authorize coverage report uploads |
Codecov's Action currently supports four inputs from the user: `token`, `file`, `flags`, and `name`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
| Input | Description | Usage |
| :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required* |
| `file` | Location of the coverage report | Optional
| `flags` | Flag upload under a certain group | Optional
| `name` | Custom defined name for the upload | Optional
### Example `workflow.yml` with Codecov Action
```yaml
name: Example workflow for Codecov
on: [push]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
version: 3.7
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
```
## Contributing
Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
## License
The code in this project is released under the MIT License
The code in this project is released under the [MIT License](LICENSE).

View File

@@ -1,10 +1,19 @@
name: 'Codecov'
description: 'Github action that uploads coverage reports for your repository to codecov.io'
author: 'Ib @ Codecov'
description: 'GitHub Action that uploads coverage reports for your repository to codecov.io'
author: 'Ibrahim Ali <@ibrahim0814> | Codecov'
inputs:
token:
description: 'Set the repository token'
name:
description: 'User defined upload name. Visible in Codecov UI'
required: false
token:
description: 'Repository upload token - get it from codecov.io'
required: true
file:
description: 'Path to coverage file to upload'
required: false
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
branding:
color: 'red'
icon: 'umbrella'
@@ -12,4 +21,8 @@ runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.name }}
- ${{ inputs.token }}
- ${{ inputs.file }}
- ${{ inputs.flags }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

21
entrypoint.sh Normal file → Executable file
View File

@@ -1,11 +1,20 @@
#!/bin/bash
#!/bin/sh
# Codecov @codecov
set -eu
if [ $# -eq 0 ]
then
bash <(curl -s https://codecov.io/bash)
if [ "x$INPUT_FILE" != 'x' ]; then
curl -s https://codecov.io/bash | bash -s -- \
-f "$INPUT_FILE" \
-t "$INPUT_TOKEN" \
-n "$INPUT_NAME" \
-F "$INPUT_FLAGS" \
-Z || echo 'Codecov upload failed'
else
bash <(curl -s https://codecov.io/bash) -t $1
curl -s https://codecov.io/bash | bash -s -- \
-t "$INPUT_TOKEN" \
-n "$INPUT_NAME" \
-F "$INPUT_FLAGS" \
-Z || echo 'Codecov upload failed'
fi