Turn over to js

This commit is contained in:
Tom Hu 2021-07-06 16:43:29 -07:00
parent 75a54f4668
commit 409204d0d0
No known key found for this signature in database
GPG key ID: F7E832BD316D5603
4 changed files with 12817 additions and 5624 deletions

View file

@ -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);