mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-12 17:10:05 +00:00
Turn over to js
This commit is contained in:
parent
75a54f4668
commit
409204d0d0
4 changed files with 12817 additions and 5624 deletions
35
src/index.ts
35
src/index.ts
|
|
@ -1,25 +1,20 @@
|
|||
const core = require('@actions/core');
|
||||
const exec = require('@actions/exec');
|
||||
|
||||
import buildExec from './buildExec';
|
||||
const superagent = require('superagent');
|
||||
|
||||
const {failCi} = buildExec();
|
||||
// import buildExec from './buildExec';
|
||||
|
||||
exec.exec('bash', ['bash/linux', '-c'])
|
||||
.then(() => {
|
||||
exec.exec(__dirname + 'codecov-linux')
|
||||
.catch((err) => {
|
||||
if (failCi) {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${err.message}`,
|
||||
);
|
||||
} else {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${err.message}`,
|
||||
);
|
||||
});
|
||||
// const {failCi} = buildExec();
|
||||
|
||||
const uploader = (async () => {
|
||||
try {
|
||||
return await superagent.get('https://uploader.codecov.io/latest/codecov-linux');
|
||||
} catch (err) {
|
||||
core.setFailed(
|
||||
`Codecov: Could not properly download uploader binary: ${err.message}`,
|
||||
);
|
||||
}
|
||||
})();
|
||||
|
||||
exec.exec(uploader);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue