codecov / codecov-action
Showing 2 of 11 files from the diff.
Newly tracked file
src/helpers.ts changed.
Other files ignored by Codecov
action.yml has changed.
package.json has changed.
src/index.ts has changed.
dist/index.js.map has changed.
dist/index.js has changed.
CHANGELOG.md has changed.
package-lock.json has changed.
src/validate.ts has changed.

@@ -9,30 +9,47 @@
Loading
9 9
    }
10 10
};
11 11
12 -
const getUploaderName = (): string => {
13 -
  if (isWindows()) {
12 +
const getUploaderName = (platform: string): string => {
13 +
  if (isWindows(platform)) {
14 14
    return 'codecov.exe';
15 15
  } else {
16 16
    return 'codecov';
17 17
  }
18 18
};
19 19
20 -
const isValidPlatform = (): boolean => {
21 -
  return PLATFORMS.includes(getPlatform());
20 +
const isValidPlatform = (platform: string): boolean => {
21 +
  return PLATFORMS.includes(platform);
22 22
};
23 23
24 -
const isWindows = (): boolean => {
25 -
  return getPlatform() === 'windows';
24 +
const isWindows = (platform: string): boolean => {
25 +
  return platform === 'windows';
26 26
};
27 27
28 -
const getPlatform = (): string => {
29 -
  return process.env.RUNNER_OS.toLowerCase();
28 +
const getPlatform = (os?: string): string => {
29 +
  if (isValidPlatform(os)) {
30 +
    core.info(`==> ${os} OS provided`);
31 +
    return os;
32 +
  }
33 +
34 +
  const platform = process.env.RUNNER_OS?.toLowerCase();
35 +
  if (isValidPlatform(platform)) {
36 +
    core.info(`==> ${platform} OS detected`);
37 +
    return platform;
38 +
  }
39 +
40 +
  core.info(
41 +
      '==> Could not detect OS or provided OS is invalid. Defaulting to linux',
42 +
  );
43 +
  return 'linux';
30 44
};
31 45
32 -
const BASEURL = `https://uploader.codecov.io/latest/${getPlatform()}/${getUploaderName()}`;
46 +
const getBaseUrl = (platform: string): string => {
47 +
  return `https://uploader.codecov.io/latest/${platform}/${getUploaderName(platform)}`;
48 +
};
33 49
34 50
export {
35 -
  BASEURL,
51 +
  PLATFORMS,
52 +
  getBaseUrl,
36 53
  getPlatform,
37 54
  getUploaderName,
38 55
  isValidPlatform,

@@ -27,6 +27,7 @@
Loading
27 27
  const flags = core.getInput('flags');
28 28
  const functionalities = core.getInput('functionalities');
29 29
  const name = core.getInput('name');
30 +
  const os = core.getInput('os');
30 31
  const overrideBranch = core.getInput('override_branch');
31 32
  const overrideBuild = core.getInput('override_build');
32 33
  const overrideCommit = core.getInput('override_commit');
@@ -146,7 +147,7 @@
Loading
146 147
    options.cwd = workingDir;
147 148
  }
148 149
149 -
  return {execArgs, options, failCi};
150 +
  return {execArgs, options, failCi, os};
150 151
};
151 152
152 153
export default buildExec;
Files Coverage
demo 85.71%
src 96.24%
Project Totals (4 files) 95.24%
codecov-script
Build #1163331836 -
windows-latest script
codecov-demo
Build #1163331836 -
windows-latest demo
codecov-script
Build #1163331830 -
windows-latest script
codecov-demo
Build #1163331830 -
windows-latest demo
codecov-script
Build #1163331836 -
ubuntu-latest script
codecov-demo
Build #1163331836 -
ubuntu-latest demo
codecov-script
Build #1163331830 -
macos-latest script
codecov-demo
Build #1163331830 -
macos-latest demo
codecov-script
Build #1163331836 -
macos-latest script
codecov-demo
Build #1163331836 -
macos-latest demo
codecov-demo
Build #1163317641 -
ubuntu-latest demo
codecov-script
Build #1163317641 -
ubuntu-latest script
codecov-demo
Build #1163317641 -
macos-latest demo
codecov-script
Build #1163317641 -
macos-latest script
codecov-demo
Build #1163317641 -
windows-latest demo
codecov-script
Build #1163317641 -
windows-latest script
codecov-script
Build #1163324005 -
ubuntu-latest script
codecov-script
Build #1163323977 -
ubuntu-latest script
codecov-demo
Build #1163324005 -
ubuntu-latest demo
codecov-demo
Build #1163323977 -
ubuntu-latest demo
codecov-script
Build #1163323977 -
macos-latest script
codecov-script
Build #1163324005 -
macos-latest script
codecov-demo
Build #1163323977 -
macos-latest demo
codecov-demo
Build #1163324005 -
macos-latest demo
codecov-demo
Build #1163324005 -
windows-latest demo
codecov-script
Build #1163324005 -
windows-latest script
codecov-demo
Build #1163323977 -
windows-latest demo
codecov-script
Build #1163323977 -
windows-latest script
codecov-demo
Build #1163331830 -
ubuntu-latest demo
codecov-script
Build #1163331830 -
ubuntu-latest script

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading