mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
62 Commits
v1.5.0
...
fail-ci-te
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2bc7b3d58 | ||
|
|
a48be3a378 | ||
|
|
d404e59e88 | ||
|
|
2d78cca173 | ||
|
|
ae8835afc4 | ||
|
|
6c61a504e3 | ||
|
|
28b82119da | ||
|
|
ccdd5a11a4 | ||
|
|
a9bf7a39e6 | ||
|
|
98a1251dbc | ||
|
|
265c6565d0 | ||
|
|
6c58d35c22 | ||
|
|
29386c70ef | ||
|
|
52497068bd | ||
|
|
fbeda37de9 | ||
|
|
ebcf63d8f0 | ||
|
|
a3e633d744 | ||
|
|
b8f68524af | ||
|
|
c9d0b8155c | ||
|
|
8f0855a85c | ||
|
|
c53d6ba320 | ||
|
|
67f597a1c4 | ||
|
|
23d300342d | ||
|
|
328e5ac01f | ||
|
|
9048ba87af | ||
|
|
004e333947 | ||
|
|
840a99b437 | ||
|
|
3cae11df75 | ||
|
|
fb7c8dcad3 | ||
|
|
8790aaf6ce | ||
|
|
e04986db44 | ||
|
|
92cbe0669f | ||
|
|
7ed20fef2d | ||
|
|
95c9f38035 | ||
|
|
5dab066a61 | ||
|
|
ff5bbb3aa8 | ||
|
|
6dfc35f92d | ||
|
|
069f3918b5 | ||
|
|
3ee49263a4 | ||
|
|
da4a4a1c99 | ||
|
|
5eebf0436a | ||
|
|
9feddcab70 | ||
|
|
a18b323e89 | ||
|
|
f8e6b45999 | ||
|
|
a737162646 | ||
|
|
18b0d954de | ||
|
|
bad627d1b6 | ||
|
|
ab8eb9dc66 | ||
|
|
407299cffc | ||
|
|
b072ed5085 | ||
|
|
1f38181652 | ||
|
|
39ec4545ca | ||
|
|
d5985f56ba | ||
|
|
4ce3eb846f | ||
|
|
b6708446cb | ||
|
|
16a94c297b | ||
|
|
c6981a3267 | ||
|
|
2494ac533b | ||
|
|
4c6214fb7a | ||
|
|
7402d15ad2 | ||
|
|
b80bc84850 | ||
|
|
b349bb9c57 |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
- name: Upload coverage to Codecov (demo)
|
||||
uses: ./
|
||||
with:
|
||||
fail_ci_if_error: false
|
||||
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
|
||||
file: ./coverage/coverage-final.json
|
||||
flags: demo
|
||||
@@ -22,6 +23,7 @@ jobs:
|
||||
- name: Upload coverage to Codecov (script)
|
||||
uses: ./
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
files: ./coverage/script/coverage-final.json
|
||||
flags: script
|
||||
name: codecov-script
|
||||
|
||||
31
CHANGELOG.md
31
CHANGELOG.md
@@ -1,3 +1,34 @@
|
||||
## 1.5.2
|
||||
### Fixes
|
||||
- # fix: Import version properly as string not object
|
||||
|
||||
## 1.5.1
|
||||
### Fixes
|
||||
- #320 doc: add github actions badge
|
||||
- #336 Update bash uploader to 1.0.3
|
||||
- #339 fix: Add action version
|
||||
|
||||
### Dependencies
|
||||
- #302 Bump @typescript-eslint/eslint-plugin from 4.22.0 to 4.22.1
|
||||
- #303 Bump @typescript-eslint/parser from 4.22.0 to 4.22.1
|
||||
- #304 Bump ts-jest from 26.5.5 to 26.5.6
|
||||
- #309 Bump lodash from 4.17.19 to 4.17.21
|
||||
- #310 Bump hosted-git-info from 2.8.8 to 2.8.9
|
||||
- #311 Bump @actions/github from 4.0.0 to 5.0.0
|
||||
- #314 Bump eslint from 7.25.0 to 7.27.0
|
||||
- #315 Bump @actions/core from 1.2.7 to 1.3.0
|
||||
- #316 Bump @typescript-eslint/parser from 4.22.1 to 4.25.0
|
||||
- #317 Bump @typescript-eslint/eslint-plugin from 4.22.1 to 4.25.0
|
||||
- #319 Bump jest-junit from 12.0.0 to 12.1.0
|
||||
- #321 Bump typescript from 4.2.4 to 4.3.2
|
||||
- #323 Bump ws from 7.3.1 to 7.4.6
|
||||
- #331 Bump eslint from 7.27.0 to 7.28.0
|
||||
- #332 Bump @actions/exec from 1.0.4 to 1.1.0
|
||||
- #333 Bump @typescript-eslint/parser from 4.25.0 to 4.26.1
|
||||
- #334 Bump @typescript-eslint/eslint-plugin from 4.25.0 to 4.26.1
|
||||
- #335 Bump @actions/core from 1.3.0 to 1.4.0
|
||||
- #337 Bump glob-parent from 5.1.1 to 5.1.2
|
||||
|
||||
## 1.5.0
|
||||
### Features
|
||||
- #299 Pull Codecov bash script into the action
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
[](https://github.com/marketplace/actions/codecov)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
|
||||
[](https://github.com/codecov/codecov-action/actions/workflows/main.yml)
|
||||
### Easily upload coverage reports to Codecov from GitHub Actions
|
||||
|
||||
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
||||
|
||||
10
dist/codecov
vendored
10
dist/codecov
vendored
@@ -2,10 +2,11 @@
|
||||
|
||||
# Apache License Version 2.0, January 2004
|
||||
# https://github.com/codecov/codecov-bash/blob/master/LICENSE
|
||||
exit 2
|
||||
|
||||
set -e +o pipefail
|
||||
|
||||
VERSION="1.0.2"
|
||||
VERSION="1.0.3"
|
||||
|
||||
codecov_flags=( )
|
||||
url="https://codecov.io"
|
||||
@@ -1866,10 +1867,9 @@ else
|
||||
-H 'Accept: text/plain' \
|
||||
$curlargs \
|
||||
"$url/upload/v2?$query&attempt=$i" || echo 'HTTP 500')
|
||||
# HTTP 200
|
||||
# http://....
|
||||
status=$(echo "$res" | head -1 | cut -d' ' -f2)
|
||||
if [ "$status" = "" ] || [ "$status" = "200" ];
|
||||
# {"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "...", "url": "https://codecov.io/..."\}
|
||||
uploaded=$(grep -o '\"uploaded\": [a-z]*' <<< "$res" | head -1 | cut -d' ' -f2)
|
||||
if [ "$uploaded" = "true" ]
|
||||
then
|
||||
say " Reports have been successfully queued for processing at ${b}$(echo "$res" | head -2 | tail -1)${x}"
|
||||
exit 0
|
||||
|
||||
633
dist/index.js
vendored
633
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
npm i --package-lock-only
|
||||
set -e
|
||||
|
||||
npm install
|
||||
npm run lint --fix
|
||||
npm run build
|
||||
git add src/
|
||||
|
||||
1521
package-lock.json
generated
1521
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codecov-action",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.2",
|
||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -23,23 +23,24 @@
|
||||
},
|
||||
"homepage": "https://github.com/codecov/codecov-action#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.7",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@types/jest": "^26.0.23",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"@actions/core": "^1.4.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"fs": "0.0.1-security",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^12.0.0",
|
||||
"request": "^2.88.2",
|
||||
"ts-jest": "^26.5.5",
|
||||
"typescript": "^4.2.4",
|
||||
"yarn": "^1.22.10"
|
||||
"request": "^2.88.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
||||
"@typescript-eslint/parser": "^4.22.0",
|
||||
"eslint": "^7.25.0",
|
||||
"eslint-config-google": "^0.14.0"
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/node": "^14.17.3",
|
||||
"@typescript-eslint/eslint-plugin": "^4.26.1",
|
||||
"@typescript-eslint/parser": "^4.26.1",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^12.2.0",
|
||||
"ts-jest": "^26.5.6",
|
||||
"typescript": "^4.3.2",
|
||||
"yarn": "^1.22.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import buildExec from './buildExec';
|
||||
const github = require('@actions/github');
|
||||
|
||||
import VERSION from './version';
|
||||
|
||||
const context = github.context;
|
||||
|
||||
test('no arguments', () => {
|
||||
@@ -12,7 +15,7 @@ test('no arguments', () => {
|
||||
'-F',
|
||||
'',
|
||||
'-Q',
|
||||
'github-action',
|
||||
`github-action-${VERSION}`,
|
||||
];
|
||||
if (context.eventName == 'pull_request') {
|
||||
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||
@@ -70,7 +73,7 @@ test('all arguments', () => {
|
||||
'-F',
|
||||
'test',
|
||||
'-Q',
|
||||
'github-action',
|
||||
`github-action-${VERSION}`,
|
||||
'-c',
|
||||
'-N',
|
||||
'83231650328f11695dfb754ca0f540516f188d27',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const core = require('@actions/core');
|
||||
const github = require('@actions/github');
|
||||
|
||||
import VERSION from './version';
|
||||
|
||||
const context = github.context;
|
||||
|
||||
const isTrue = (variable) => {
|
||||
@@ -51,7 +53,14 @@ const buildExec = () => {
|
||||
workingDir + '/codecov.sh' : 'codecov.sh';
|
||||
|
||||
const execArgs = [filepath];
|
||||
execArgs.push( '-n', `${name}`, '-F', `${flags}`, '-Q', 'github-action' );
|
||||
execArgs.push(
|
||||
'-n',
|
||||
`${name}`,
|
||||
'-F',
|
||||
`${flags}`,
|
||||
'-Q',
|
||||
`github-action-${VERSION}`,
|
||||
);
|
||||
|
||||
const options:any = {};
|
||||
options.env = Object.assign(process.env, {
|
||||
|
||||
10
src/codecov
10
src/codecov
@@ -2,10 +2,11 @@
|
||||
|
||||
# Apache License Version 2.0, January 2004
|
||||
# https://github.com/codecov/codecov-bash/blob/master/LICENSE
|
||||
exit 2
|
||||
|
||||
set -e +o pipefail
|
||||
|
||||
VERSION="1.0.2"
|
||||
VERSION="1.0.3"
|
||||
|
||||
codecov_flags=( )
|
||||
url="https://codecov.io"
|
||||
@@ -1866,10 +1867,9 @@ else
|
||||
-H 'Accept: text/plain' \
|
||||
$curlargs \
|
||||
"$url/upload/v2?$query&attempt=$i" || echo 'HTTP 500')
|
||||
# HTTP 200
|
||||
# http://....
|
||||
status=$(echo "$res" | head -1 | cut -d' ' -f2)
|
||||
if [ "$status" = "" ] || [ "$status" = "200" ];
|
||||
# {"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "...", "url": "https://codecov.io/..."\}
|
||||
uploaded=$(grep -o '\"uploaded\": [a-z]*' <<< "$res" | head -1 | cut -d' ' -f2)
|
||||
if [ "$uploaded" = "true" ]
|
||||
then
|
||||
say " Reports have been successfully queued for processing at ${b}$(echo "$res" | head -2 | tail -1)${x}"
|
||||
exit 0
|
||||
|
||||
@@ -20,6 +20,7 @@ try {
|
||||
|
||||
exec.exec('bash', execArgs, options)
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
if (failCi) {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${err.message}`,
|
||||
@@ -28,7 +29,8 @@ try {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
.then((status) => {
|
||||
console.log(status);
|
||||
unlinkFile();
|
||||
});
|
||||
|
||||
|
||||
3
src/version.ts
Normal file
3
src/version.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
const VERSION = 'v1.5.2';
|
||||
|
||||
export default VERSION;
|
||||
Reference in New Issue
Block a user