mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5749ba79a | ||
|
|
b4c0b83601 | ||
|
|
3cde50f4f1 | ||
|
|
10e590a5de | ||
|
|
af19dcb193 | ||
|
|
77e74f257f | ||
|
|
1c4a4261fa | ||
|
|
cb218a0977 | ||
|
|
e78f79e460 |
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -21,4 +21,3 @@ jobs:
|
||||
token: ${{secrets.CODECOV_TOKEN}}
|
||||
flags: unittest
|
||||
name: codecov-1
|
||||
#badstuff: morebadstuff
|
||||
|
||||
17
Dockerfile
17
Dockerfile
@@ -1,12 +1,15 @@
|
||||
# Codecov @codecov
|
||||
|
||||
FROM ubuntu:latest
|
||||
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 apt update && apt install -y curl
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Codecov GitHub Action
|
||||
|
||||
[](https://github.com/marketplace/actions/codecov)
|
||||
[](https://github.com/marketplace/actions/codecov)
|
||||
### Easily upload coverage reports to Codecov from GitHub Actions
|
||||
|
||||
## Usage
|
||||
@@ -12,7 +12,7 @@ Inside your `.github/workflows/workflow.yml` file:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: codecov/codecov-action@v1.0.0
|
||||
- uses: codecov/codecov-action@v1.0.3
|
||||
with:
|
||||
token: ${{secrets.CODECOV_TOKEN}} #required
|
||||
file: ./coverage.xml #optional
|
||||
@@ -52,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
|
||||
|
||||
@@ -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
44
entrypoint.sh
Normal file → Executable 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
|
||||
curl -s https://codecov.io/bash | bash -s -- -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
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS
|
||||
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_NAME" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE -n $INPUT_NAME
|
||||
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -n $INPUT_NAME -F $INPUT_FLAGS
|
||||
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE
|
||||
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -F $INPUT_FLAGS
|
||||
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -n $INPUT_NAME
|
||||
elif [ "x$INPUT_TOKEN" != "x" ]
|
||||
then
|
||||
curl -s https://codecov.io/bash | bash -s -- -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
|
||||
|
||||
Reference in New Issue
Block a user