Compare commits

...
53 Commits
Author SHA1 Message Date
ibrahim0814 e6cea4aaed update readme 2019-11-19 04:18:00 -08:00
ibrahim0814 70f2402e00 Merge branch 'node-action' of github.com:codecov/codecov-action into node-action 2019-11-19 04:06:13 -08:00
ibrahim0814 e6af53269a rem node modules, add gitignore, dist folder 2019-11-19 04:05:04 -08:00
Ibrahim Ali 7ab923356b Merge branch 'master' into node-action 2019-11-19 03:38:12 -08:00
ibrahim0814 8676a5a946 update readme, contributing, and add yml input 2019-11-19 03:36:06 -08:00
ibrahim0814 6afe2e0d90 fix logic 2019-11-19 00:28:57 -08:00
ibrahim0814 67a2282699 clean up, add other inputs 2019-11-19 00:24:27 -08:00
ibrahim0814 e1a57b8a47 try using user supplied token 2019-11-18 23:56:52 -08:00
ibrahim0814 1be0517b99 try saving bash script as file 2019-11-18 23:39:04 -08:00
ibrahim0814 889584d6f9 try using actions exec 2019-11-18 22:51:40 -08:00
ibrahim0814 c4ca0425e1 try synchronous process instead of async 2019-11-18 14:41:41 -08:00
Ibrahim Ali 8d062b28e1 Add if conditional in example for linux 2019-11-17 10:35:11 -08:00
ibrahim0814 a3ae14ab33 add env vars 2019-11-14 01:29:03 -08:00
ibrahim0814 1259587051 output 2019-11-14 01:12:21 -08:00
ibrahim0814 dd61d9f90b rem extra files 2019-11-14 01:05:31 -08:00
ibrahim0814 6e83ad2f33 rm first 8 lines of code 2019-11-14 01:04:58 -08:00
ibrahim0814 747c905e39 more output 2019-11-14 00:47:48 -08:00
ibrahim0814 29e36a5e71 try exec file 2019-11-14 00:43:05 -08:00
ibrahim0814 f0ee262b3a try exec file 2019-11-14 00:29:39 -08:00
ibrahim0814 bab0bf56a8 try 2 replacing pipe line 2019-11-14 00:16:42 -08:00
ibrahim0814 efc5cbe89b try removing pipefail line 2019-11-14 00:10:36 -08:00
ibrahim0814 3d61f3d4c8 correct docker to node12 2019-11-13 23:44:35 -08:00
ibrahim0814 db0171f588 try with exec sh 2019-11-13 23:41:15 -08:00
Ibrahim Ali 7ba41fc0d6 update readme to reflect linux support only 2019-11-11 10:04:33 -08:00
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
12 changed files with 34720 additions and 74 deletions
Vendored
BIN
View File
Binary file not shown.
+23
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
+92
View File
@@ -0,0 +1,92 @@
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# react / gatsby
public/
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
+3 -3
View File
File diff suppressed because one or more lines are too long
-12
View File
@@ -1,12 +0,0 @@
# Codecov @codecov
FROM alpine:3.10
WORKDIR /app
COPY . /app
RUN apk add --no-cache curl bash git
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ]
+21 -12
View File
File diff suppressed because one or more lines are too long
+7 -9
View File
@@ -7,22 +7,20 @@ 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
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
yml:
description: 'Specify the location of the .codecov.yml config file'
required: false
branding:
color: 'red'
icon: 'umbrella'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.name }}
- ${{ inputs.token }}
- ${{ inputs.file }}
- ${{ inputs.flags }}
using: 'node12'
main: 'dist/index.js'
+33647
View File
File diff suppressed because one or more lines are too long
-38
View File
@@ -1,38 +0,0 @@
#!/bin/bash
# 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
else
echo "Please provide an upload token from codecov.io with valid arguments"
exit 1
fi
+72
View File
@@ -0,0 +1,72 @@
const core = require("@actions/core");
const exec = require("@actions/exec");
const request = require("request");
const fs = require("fs");
try {
const name = core.getInput("name");
const token = core.getInput("token");
const flags = core.getInput("flags");
const file = core.getInput("file");
const yml = core.getInput("yml");
request("https://codecov.io/bash", (error, response, body) => {
if (error) throw error;
fs.writeFile("codecov.sh", body, err => {
if (err) throw err;
let output = "";
let execError = "";
const options = {};
options.listeners = {
stdout: data => {
output += data.toString();
},
stderr: data => {
execError += data.toString();
}
};
options.env = {
CODECOV_TOKEN: `${token}`,
GITHUB_ACTION: process.env.GITHUB_ACTION,
GITHUB_REF: process.env.GITHUB_REF,
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY,
GITHUB_SHA: process.env.GITHUB_SHA
};
if (file) {
exec
.exec(
"bash",
["codecov.sh", "-f", `${file}`, "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
options
)
.then(() => {
unlinkFile()
});
} else {
exec
.exec(
"bash",
["codecov.sh", "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
options
)
.then(() => {
unlinkFile()
});
}
const unlinkFile = () => {
fs.unlink("codecov.sh", err => {
if (err) throw err;
});
}
});
});
} catch (error) {
core.setFailed(error.message);
}
+829
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
{
"name": "test2",
"version": "1.0.0",
"description": "[![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",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/codecov/codecov-action.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/codecov/codecov-action/issues"
},
"homepage": "https://github.com/codecov/codecov-action#readme",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"fs": "0.0.1-security",
"request": "^2.88.0"
}
}