Compare commits

...

22 Commits

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
5 changed files with 54 additions and 44 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

View File

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

View File

@@ -1,5 +1,7 @@
# Codecov GitHub Action
### Easily upload coverage reports to Codecov from GitHub Actions
# Codecov GitHub Action
[![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
@@ -10,7 +12,7 @@ Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v1.0.0
- uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
@@ -50,7 +52,7 @@ jobs:
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.0
uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml

View File

@@ -7,7 +7,7 @@ inputs:
required: false
token:
description: 'Repository upload token - get it from codecov.io'
required: false
required: true
file:
description: 'Path to coverage file to upload'
required: false
@@ -25,4 +25,4 @@ runs:
- ${{ inputs.token }}
- ${{ inputs.file }}
- ${{ inputs.flags }}

44
entrypoint.sh Normal file → Executable file
View File

@@ -1,38 +1,20 @@
#!/bin/bash
#!/bin/sh
# Codecov @codecov
set -eu
if [ $# -eq 0 ]
then
echo "Please provide an upload token from codecov.io"
exit 1
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -n $INPUT_NAME -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN
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
echo "Please provide an upload token from codecov.io with valid arguments"
exit 1
curl -s https://codecov.io/bash | bash -s -- \
-t "$INPUT_TOKEN" \
-n "$INPUT_NAME" \
-F "$INPUT_FLAGS" \
-Z || echo 'Codecov upload failed'
fi