mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
a1ed4b322b | ||
|
|
2332a737fb | ||
|
|
dc56cf479e | ||
|
|
a5399823bb | ||
|
|
9f471fc6f8 | ||
|
|
062fb177ae | ||
|
|
31d2c8f775 | ||
|
|
47ed2776b9 | ||
|
|
b37e21182f | ||
|
|
fd42ae77ab | ||
|
|
998cb33cad | ||
|
|
052dc5d29d | ||
|
|
3e2901753e | ||
|
|
6b52f2a1d9 | ||
|
|
4789835c72 | ||
|
|
47b1f9735f | ||
|
|
298ba60aef | ||
|
|
abf28f2040 | ||
|
|
cdc2a0ed57 | ||
|
|
967e2b38a8 | ||
|
|
77a7b61cd5 | ||
|
|
50895b2a6f | ||
|
|
95e6f30a60 | ||
|
|
0e28ff86a5 | ||
|
|
72182f9425 | ||
|
|
ce1ffb8db7 | ||
|
|
864620acb9 | ||
|
|
6ac8172373 | ||
|
|
5ab0dbc584 | ||
|
|
5e8c27dd4d | ||
|
|
444b352d52 | ||
|
|
83cbbf806b | ||
|
|
040839f579 | ||
|
|
6e56f7a5a6 | ||
|
|
ae04cc96c3 | ||
|
|
d2569b4d35 | ||
|
|
216c5372a9 | ||
|
|
9b0b9bbe2c | ||
|
|
1ee0196081 | ||
|
|
c6a36d2dbb | ||
|
|
aaf0ccb935 | ||
|
|
d9a1bbc2da | ||
|
|
18017b2a95 | ||
|
|
fcebab03f2 | ||
|
|
7ea3ba9ac0 | ||
|
|
6ed0d16b40 | ||
|
|
79a0ba12c8 | ||
|
|
b349bb9c57 | ||
|
|
1f8f3abccc | ||
|
|
763298c6f6 | ||
|
|
3207ad4e60 | ||
|
|
ab3cfafc5b | ||
|
|
b708b7e81f | ||
|
|
65f43cece2 | ||
|
|
21a1e2948d | ||
|
|
227f879cd0 | ||
|
|
87fff2e891 | ||
|
|
50212c96c8 | ||
|
|
e77dab65bf | ||
|
|
ddfe212d72 | ||
|
|
71a6279758 | ||
|
|
6a50e6841d | ||
|
|
482a90585e | ||
|
|
b977d6544b | ||
|
|
4c6543136b | ||
|
|
28d300eaea | ||
|
|
36360aa09d | ||
|
|
f215202b84 | ||
|
|
7cd1dd7eac | ||
|
|
98c0755768 | ||
|
|
9347908382 | ||
|
|
ae688b209d | ||
|
|
d7eb181d2f | ||
|
|
a231e699a2 | ||
|
|
29fb46218a | ||
|
|
ad2aaf2f71 | ||
|
|
ca774cf8f0 | ||
|
|
44d1ae6c73 | ||
|
|
ed0e49eac0 | ||
|
|
ed1a046a3f | ||
|
|
16636eb6e0 | ||
|
|
b3274555d8 | ||
|
|
53f9cbed3c | ||
|
|
14434e0c72 | ||
|
|
2838b54ec2 | ||
|
|
33faa01b4d | ||
|
|
ebab471b65 | ||
|
|
1789bbabef | ||
|
|
eedcbd59dc | ||
|
|
83e6a29c16 | ||
|
|
dd9b809996 | ||
|
|
61b20ce181 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -6,8 +6,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Lint
|
- name: Lint
|
||||||
|
|||||||
94
CHANGELOG.md
94
CHANGELOG.md
@@ -1,32 +1,98 @@
|
|||||||
### 1.2.1
|
## 1.5.2
|
||||||
|
### Fixes
|
||||||
|
- # fix: Import version properly as string not object
|
||||||
|
|
||||||
#### Fixes
|
## 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
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
- #271 Bump typescript from 4.2.3 to 4.2.4
|
||||||
|
- #277 Bump @typescript-eslint/eslint-plugin from 4.16.1 to 4.22.0
|
||||||
|
- #278 Bump @typescript-eslint/parser from 4.20.0 to 4.22.0
|
||||||
|
- #279 Bump @actions/core from 1.2.6 to 1.2.7
|
||||||
|
- #292 Bump ts-jest from 26.5.3 to 26.5.5
|
||||||
|
- #293 Bump eslint from 7.21.0 to 7.25.0
|
||||||
|
- #297 Bump @types/jest from 26.0.20 to 26.0.23
|
||||||
|
- #298 Upgrade to GitHub-native Dependabot
|
||||||
|
|
||||||
|
## 1.4.1
|
||||||
|
### Fixes
|
||||||
|
- #287 Update VERSION regex to restrict on digits and dot and move checksums into script
|
||||||
|
|
||||||
|
## 1.4.0
|
||||||
|
### Features
|
||||||
|
- #282 Add checksum verification of bash script
|
||||||
|
|
||||||
|
## 1.3.2
|
||||||
|
### Fixes
|
||||||
|
- #264 Overwrites pr number for pull_request_target events
|
||||||
|
|
||||||
|
## 1.3.1
|
||||||
|
### Fixes
|
||||||
|
- #253 Add `network_filter` to action manifest
|
||||||
|
|
||||||
|
## 1.3.0
|
||||||
|
### Features
|
||||||
|
- #252 Add "network_filter" input
|
||||||
|
|
||||||
|
## 1.2.2
|
||||||
|
### Fixes
|
||||||
|
- #241 pass root_dir using proper bash arg
|
||||||
|
- #244 Overwrite the commit on pull_request* events
|
||||||
|
|
||||||
|
## 1.2.1
|
||||||
|
### Fixes
|
||||||
- #196 Add parameters to the action.yml
|
- #196 Add parameters to the action.yml
|
||||||
|
|
||||||
### 1.2.0
|
## 1.2.0
|
||||||
|
### Features
|
||||||
#### Features
|
|
||||||
- #193 Add all the bash params
|
- #193 Add all the bash params
|
||||||
|
|
||||||
#### Fixes
|
### Fixes
|
||||||
- #193 Fixes issue with working-directory
|
- #193 Fixes issue with working-directory
|
||||||
|
|
||||||
### 1.1.1
|
## 1.1.1
|
||||||
|
### Fixes
|
||||||
#### Fixes
|
|
||||||
- #184 Add automations ensure proper builds and deployments
|
- #184 Add automations ensure proper builds and deployments
|
||||||
- #184 Fixes verbose flag
|
- #184 Fixes verbose flag
|
||||||
|
|
||||||
### 1.1.0
|
## 1.1.0
|
||||||
|
### Features
|
||||||
#### Features
|
|
||||||
- #110 Add "working-directory:" input
|
- #110 Add "working-directory:" input
|
||||||
- #174 Support Xcode specificed parameters
|
- #174 Support Xcode specificed parameters
|
||||||
|
|
||||||
#### Fixes
|
### Fixes
|
||||||
- #172 File is saved as text
|
- #172 File is saved as text
|
||||||
|
|
||||||
#### Dependencies and Misc
|
### Dependencies and Misc
|
||||||
- #166 Bump requestretry from 4.1.1 to 4.1.2
|
- #166 Bump requestretry from 4.1.1 to 4.1.2
|
||||||
- #169 Bump typescript from 4.0.5 to 4.1.2
|
- #169 Bump typescript from 4.0.5 to 4.1.2
|
||||||
- #178 Bump @types/jest from 26.0.15 to 26.0.19
|
- #178 Bump @types/jest from 26.0.15 to 26.0.19
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[](https://github.com/marketplace/actions/codecov)
|
[](https://github.com/marketplace/actions/codecov)
|
||||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
|
[](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
|
### Easily upload coverage reports to Codecov from GitHub Actions
|
||||||
|
|
||||||
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ inputs:
|
|||||||
name:
|
name:
|
||||||
description: 'User defined upload name. Visible in Codecov UI'
|
description: 'User defined upload name. Visible in Codecov UI'
|
||||||
required: false
|
required: false
|
||||||
|
network_filter:
|
||||||
|
description: 'Used to restrict the set of git/hg files that can be matched with filenames in the coverage report. This is useful for monorepos or other setups where a full filepath may not be specified in the coverage report, and that shortened filepath may appear multiple times in a directory structure (e.g. __init__.py)'
|
||||||
|
required: false
|
||||||
override_branch:
|
override_branch:
|
||||||
description: 'Specify the branch name'
|
description: 'Specify the branch name'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
1883
dist/codecov
vendored
Normal file
1883
dist/codecov
vendored
Normal file
File diff suppressed because it is too large
Load Diff
57663
dist/index.js
vendored
57663
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -4,5 +4,5 @@ npm i --package-lock-only
|
|||||||
npm run lint --fix
|
npm run lint --fix
|
||||||
npm run build
|
npm run build
|
||||||
git add src/
|
git add src/
|
||||||
git add dist/index.js
|
git add dist/
|
||||||
git add package-lock.json
|
git add package-lock.json
|
||||||
|
|||||||
717
package-lock.json
generated
717
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.2.1",
|
"version": "1.5.2",
|
||||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -23,23 +23,23 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/codecov/codecov-action#readme",
|
"homepage": "https://github.com/codecov/codecov-action#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.4.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.1.0",
|
||||||
"@types/jest": "^26.0.19",
|
"@actions/github": "^5.0.0",
|
||||||
|
"@types/jest": "^26.0.23",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"jest-junit": "^12.0.0",
|
"jest-junit": "^12.1.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^4.1.2",
|
"ts-jest": "^26.5.6",
|
||||||
"ts-jest": "^26.4.4",
|
"typescript": "^4.3.2",
|
||||||
"typescript": "^4.1.3",
|
|
||||||
"yarn": "^1.22.10"
|
"yarn": "^1.22.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^4.11.1",
|
"@typescript-eslint/eslint-plugin": "^4.26.1",
|
||||||
"@typescript-eslint/parser": "^4.11.1",
|
"@typescript-eslint/parser": "^4.26.1",
|
||||||
"eslint": "^7.17.0",
|
"eslint": "^7.28.0",
|
||||||
"eslint-config-google": "^0.14.0"
|
"eslint-config-google": "^0.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,26 @@
|
|||||||
import buildExec from './buildExec';
|
import buildExec from './buildExec';
|
||||||
|
const github = require('@actions/github');
|
||||||
|
|
||||||
|
import VERSION from './version';
|
||||||
|
|
||||||
|
const context = github.context;
|
||||||
|
|
||||||
test('no arguments', () => {
|
test('no arguments', () => {
|
||||||
const {execArgs, filepath, failCi} = buildExec();
|
const {execArgs, filepath, failCi} = buildExec();
|
||||||
expect(execArgs).toEqual([
|
|
||||||
|
const args = [
|
||||||
'codecov.sh',
|
'codecov.sh',
|
||||||
'-n',
|
'-n',
|
||||||
'',
|
'',
|
||||||
'-F',
|
'-F',
|
||||||
'',
|
'',
|
||||||
'-Q',
|
'-Q',
|
||||||
'github-action',
|
`github-action-${VERSION}`,
|
||||||
]);
|
];
|
||||||
|
if (context.eventName == 'pull_request') {
|
||||||
|
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
}
|
||||||
|
expect(execArgs).toEqual(args);
|
||||||
expect(filepath).toEqual('codecov.sh');
|
expect(filepath).toEqual('codecov.sh');
|
||||||
expect(failCi).toBeFalsy();
|
expect(failCi).toBeFalsy();
|
||||||
});
|
});
|
||||||
@@ -35,6 +45,7 @@ test('all arguments', () => {
|
|||||||
'gcov_path_include': '**/include-dir/*.*',
|
'gcov_path_include': '**/include-dir/*.*',
|
||||||
'gcov_prefix': 'demo',
|
'gcov_prefix': 'demo',
|
||||||
'name': 'codecov',
|
'name': 'codecov',
|
||||||
|
'network_filter': 'dir1',
|
||||||
'override_branch': 'thomasrockhu/test',
|
'override_branch': 'thomasrockhu/test',
|
||||||
'override_build': '1',
|
'override_build': '1',
|
||||||
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
|
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
@@ -62,7 +73,7 @@ test('all arguments', () => {
|
|||||||
'-F',
|
'-F',
|
||||||
'test',
|
'test',
|
||||||
'-Q',
|
'-Q',
|
||||||
'github-action',
|
`github-action-${VERSION}`,
|
||||||
'-c',
|
'-c',
|
||||||
'-N',
|
'-N',
|
||||||
'83231650328f11695dfb754ca0f540516f188d27',
|
'83231650328f11695dfb754ca0f540516f188d27',
|
||||||
@@ -107,6 +118,8 @@ test('all arguments', () => {
|
|||||||
'**/include-dir/*.*',
|
'**/include-dir/*.*',
|
||||||
'-k',
|
'-k',
|
||||||
'demo',
|
'demo',
|
||||||
|
'-i',
|
||||||
|
'dir1',
|
||||||
'-B',
|
'-B',
|
||||||
'thomasrockhu/test',
|
'thomasrockhu/test',
|
||||||
'-b',
|
'-b',
|
||||||
@@ -117,7 +130,7 @@ test('all arguments', () => {
|
|||||||
'2',
|
'2',
|
||||||
'-T',
|
'-T',
|
||||||
'v1.2',
|
'v1.2',
|
||||||
'-N',
|
'-R',
|
||||||
'root/',
|
'root/',
|
||||||
'-s',
|
'-s',
|
||||||
'coverage/',
|
'coverage/',
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
const github = require('@actions/github');
|
||||||
|
|
||||||
|
import VERSION from './version';
|
||||||
|
|
||||||
|
const context = github.context;
|
||||||
|
|
||||||
const isTrue = (variable) => {
|
const isTrue = (variable) => {
|
||||||
const lowercase = variable.toLowerCase();
|
const lowercase = variable.toLowerCase();
|
||||||
@@ -29,6 +34,7 @@ const buildExec = () => {
|
|||||||
const gcovInclude = core.getInput('gcov_path_include');
|
const gcovInclude = core.getInput('gcov_path_include');
|
||||||
const gcovPrefix = core.getInput('gcov_prefix');
|
const gcovPrefix = core.getInput('gcov_prefix');
|
||||||
const name = core.getInput('name');
|
const name = core.getInput('name');
|
||||||
|
const networkFilter = core.getInput('network_filter');
|
||||||
const overrideBranch = core.getInput('override_branch');
|
const overrideBranch = core.getInput('override_branch');
|
||||||
const overrideBuild = core.getInput('override_build');
|
const overrideBuild = core.getInput('override_build');
|
||||||
const overrideCommit = core.getInput('override_commit');
|
const overrideCommit = core.getInput('override_commit');
|
||||||
@@ -47,7 +53,14 @@ const buildExec = () => {
|
|||||||
workingDir + '/codecov.sh' : 'codecov.sh';
|
workingDir + '/codecov.sh' : 'codecov.sh';
|
||||||
|
|
||||||
const execArgs = [filepath];
|
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 = {};
|
const options:any = {};
|
||||||
options.env = Object.assign(process.env, {
|
options.env = Object.assign(process.env, {
|
||||||
@@ -120,6 +133,9 @@ const buildExec = () => {
|
|||||||
if (gcovPrefix) {
|
if (gcovPrefix) {
|
||||||
execArgs.push('-k', `${gcovPrefix}`);
|
execArgs.push('-k', `${gcovPrefix}`);
|
||||||
}
|
}
|
||||||
|
if (networkFilter) {
|
||||||
|
execArgs.push('-i', `${networkFilter}`);
|
||||||
|
}
|
||||||
if (overrideBranch) {
|
if (overrideBranch) {
|
||||||
execArgs.push('-B', `${overrideBranch}`);
|
execArgs.push('-B', `${overrideBranch}`);
|
||||||
}
|
}
|
||||||
@@ -128,15 +144,24 @@ const buildExec = () => {
|
|||||||
}
|
}
|
||||||
if (overrideCommit) {
|
if (overrideCommit) {
|
||||||
execArgs.push('-C', `${overrideCommit}`);
|
execArgs.push('-C', `${overrideCommit}`);
|
||||||
|
} else if (
|
||||||
|
`${context.eventName}` == 'pull_request' ||
|
||||||
|
`${context.eventName}` == 'pull_request_target'
|
||||||
|
) {
|
||||||
|
execArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
}
|
}
|
||||||
if (overridePr) {
|
if (overridePr) {
|
||||||
execArgs.push('-P', `${overridePr}`);
|
execArgs.push('-P', `${overridePr}`);
|
||||||
|
} else if (
|
||||||
|
`${context.eventName}` == 'pull_request_target'
|
||||||
|
) {
|
||||||
|
execArgs.push('-P', `${context.payload.number}`);
|
||||||
}
|
}
|
||||||
if (overrideTag) {
|
if (overrideTag) {
|
||||||
execArgs.push('-T', `${overrideTag}`);
|
execArgs.push('-T', `${overrideTag}`);
|
||||||
}
|
}
|
||||||
if (rootDir) {
|
if (rootDir) {
|
||||||
execArgs.push('-N', `${rootDir}`);
|
execArgs.push('-R', `${rootDir}`);
|
||||||
}
|
}
|
||||||
if (searchDir) {
|
if (searchDir) {
|
||||||
execArgs.push('-s', `${searchDir}`);
|
execArgs.push('-s', `${searchDir}`);
|
||||||
|
|||||||
1883
src/codecov
Normal file
1883
src/codecov
Normal file
File diff suppressed because it is too large
Load Diff
71
src/index.ts
71
src/index.ts
@@ -1,63 +1,46 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const exec = require('@actions/exec');
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const request = require('requestretry');
|
|
||||||
|
|
||||||
import buildExec from './buildExec';
|
import buildExec from './buildExec';
|
||||||
|
|
||||||
|
const codecovScript = fs.readFileSync(__dirname + '/codecov');
|
||||||
|
|
||||||
let failCi;
|
let failCi;
|
||||||
try {
|
try {
|
||||||
request({
|
const {execArgs, options, filepath, failCi} = buildExec();
|
||||||
json: false,
|
|
||||||
maxAttempts: 10,
|
|
||||||
timeout: 3000,
|
|
||||||
url: 'https://codecov.io/bash',
|
|
||||||
}, (error, response, body) => {
|
|
||||||
const {execArgs, options, filepath, failCi} = buildExec();
|
|
||||||
|
|
||||||
try {
|
fs.writeFile(filepath, codecovScript, (err) => {
|
||||||
if (error && failCi) {
|
if (err && failCi) {
|
||||||
throw error;
|
throw err;
|
||||||
} else if (error) {
|
} else if (err) {
|
||||||
core.warning(`Codecov warning: ${error.message}`);
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFile(filepath, body, (err) => {
|
exec.exec('bash', execArgs, options)
|
||||||
|
.catch((err) => {
|
||||||
|
if (failCi) {
|
||||||
|
core.setFailed(
|
||||||
|
`Codecov failed with the following error: ${err.message}`,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
unlinkFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
const unlinkFile = () => {
|
||||||
|
fs.unlink(filepath, (err) => {
|
||||||
if (err && failCi) {
|
if (err && failCi) {
|
||||||
throw err;
|
throw err;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
core.warning(`Codecov warning: ${err.message}`);
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
exec.exec('bash', execArgs, options)
|
|
||||||
.catch((err) => {
|
|
||||||
if (failCi) {
|
|
||||||
core.setFailed(
|
|
||||||
`Codecov failed with the following error: ${err.message}`,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
core.warning(`Codecov warning: ${err.message}`);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
unlinkFile();
|
|
||||||
});
|
|
||||||
|
|
||||||
const unlinkFile = () => {
|
|
||||||
fs.unlink(filepath, (err) => {
|
|
||||||
if (err && failCi) {
|
|
||||||
throw err;
|
|
||||||
} else if (err) {
|
|
||||||
core.warning(`Codecov warning: ${err.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
};
|
||||||
core.setFailed(
|
|
||||||
`Codecov failed with the following error: ${error.message}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (failCi) {
|
if (failCi) {
|
||||||
|
|||||||
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