Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use cli instead of node uploader #1068

Merged
merged 4 commits into from Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Upload coverage to Codecov (script)
uses: ./
with:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Lint
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js
Expand Up @@ -22333,7 +22333,7 @@ const getBaseUrl = (platform, version) => {
return `https://cli.codecov.io/${version}/${platform}/${getUploaderName(platform)}`;
};
const getCommand = (filename, generalArgs, command) => {
return filename + ' ' + generalArgs.join(' ') + ' ' + command;
return [filename, ...generalArgs, command];
};


Expand Down Expand Up @@ -24637,14 +24637,14 @@ try {
});
};
const doUpload = () => src_awaiter(void 0, void 0, void 0, function* () {
yield exec.exec(getCommand(filename, args, uploadCommand), uploadExecArgs, uploadOptions)
yield exec.exec(getCommand(filename, args, uploadCommand).join(" "), uploadExecArgs, uploadOptions)
dana-yaish marked this conversation as resolved.
Show resolved Hide resolved
.catch((err) => {
setFailure(`Codecov:
Failed to properly upload report: ${err.message}`, failCi);
});
});
const createReport = () => src_awaiter(void 0, void 0, void 0, function* () {
yield exec.exec(getCommand(filename, args, reportCommand), reportExecArgs, reportOptions)
yield exec.exec(getCommand(filename, args, reportCommand).join(" "), reportExecArgs, reportOptions)
.then((exitCode) => src_awaiter(void 0, void 0, void 0, function* () {
if (exitCode == 0) {
yield doUpload();
Expand All @@ -24654,7 +24654,7 @@ try {
Failed to properly create report: ${err.message}`, failCi);
});
});
yield exec.exec(getCommand(filename, args, commitCommand), commitExecArgs, commitOptions)
yield exec.exec(getCommand(filename, args, commitCommand).join(" "), commitExecArgs, commitOptions)
.then((exitCode) => src_awaiter(void 0, void 0, void 0, function* () {
if (exitCode == 0) {
yield createReport();
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/helpers.test.ts
Expand Up @@ -70,5 +70,5 @@ test('isValidPlatform', () => {

test('getCommand', () => {
expect(getCommand('path', ['-v', '-x'], 'do-upload'))
.toEqual('path -v -x do-upload');
.toEqual(['path', '-v', '-x', 'do-upload']);
});
4 changes: 2 additions & 2 deletions src/helpers.ts
Expand Up @@ -55,8 +55,8 @@ const getCommand = (
filename: string,
generalArgs:string[],
command: string,
): string => {
return filename + ' ' + generalArgs.join(' ') + ' ' + command;
): string[] => {
return [filename, ...generalArgs, command];
};

export {
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Expand Up @@ -67,7 +67,7 @@ try {
});
};
const doUpload = async () => {
await exec.exec(getCommand(filename, args, uploadCommand),
await exec.exec(getCommand(filename, args, uploadCommand).join(' '),
uploadExecArgs,
uploadOptions)
.catch((err) => {
Expand All @@ -80,7 +80,7 @@ try {
};
const createReport = async () => {
await exec.exec(
getCommand(filename, args, reportCommand),
getCommand(filename, args, reportCommand).join(' '),
reportExecArgs,
reportOptions)
.then(async (exitCode) => {
Expand All @@ -100,7 +100,8 @@ try {
filename,
args,
commitCommand,
), commitExecArgs, commitOptions)
).join(' '),
commitExecArgs, commitOptions)
.then(async (exitCode) => {
if (exitCode == 0) {
await createReport();
Expand Down