Merge pull request #699 from codecov/feat-xcode

feat: add xcode support
This commit is contained in:
Tom Hu
2022-04-21 10:49:01 -04:00
committed by GitHub
12 changed files with 54 additions and 12 deletions

View File

@@ -1,3 +1,12 @@
## 3.1.0
### Features
- #699 Incorporate `xcode` arguments for the Codecov uploader
### Dependencies
- #694 build(deps-dev): bump @vercel/ncc from 0.33.3 to 0.33.4
- #696 build(deps-dev): bump @types/node from 17.0.23 to 17.0.25
- #698 build(deps-dev): bump jest-junit from 13.0.0 to 13.2.0
## 3.0.0
### Breaking Changes
- #689 Bump to node16 and small fixes

View File

@@ -61,10 +61,10 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
| `functionalities` | Toggle functionalities | Optional
| | `network` Disable uploading the file network |
| `gcov` | Run with gcov support |
| `gcov_args` | Extra arguments to pass to gcov |
| `gcov_ignore` | Paths to ignore during gcov gathering |
| `gcov_include` | Paths to include during gcov gathering |
| `gcov` | Run with gcov support | Optional
| `gcov_args` | Extra arguments to pass to gcov | Optional
| `gcov_ignore` | Paths to ignore during gcov gathering | Optional
| `gcov_include` | Paths to include during gcov gathering | Optional
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
| `name` | Custom defined name for the upload | Optional
| `override_branch` | Specify the branch name | Optional
@@ -79,6 +79,9 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `version` | Specify which version of the Codecov Uploader should be used. Defaults to `latest` | Optional
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
| `xcode` | Run with xcode support | Optional
| `xcode_archive_path` | Specify the xcode archive path. Likely specified as the -resultBundlePath and should end in .xcresult | Optional
### Example `workflow.yml` with Codecov Action

View File

@@ -86,6 +86,12 @@ inputs:
working-directory:
description: 'Directory in which to execute codecov.sh'
required: false
xcode:
description: 'Run with xcode support'
required: false
xcode_archive_path:
description: 'Specify the xcode archive path. Likely specified as the -resultBundlePath and should end in .xcresult'
required: false
branding:
color: 'red'
icon: 'umbrella'

8
dist/index.js vendored
View File

@@ -19346,7 +19346,7 @@ var core = __nccwpck_require__(2186);
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
var github = __nccwpck_require__(5438);
;// CONCATENATED MODULE: ./package.json
const package_namespaceObject = {"i8":"3.0.0"};
const package_namespaceObject = {"i8":"3.1.0"};
;// CONCATENATED MODULE: ./src/buildExec.ts
@@ -19389,6 +19389,8 @@ const buildExec = () => {
const url = core.getInput('url');
const verbose = isTrue(core.getInput('verbose'));
const workingDir = core.getInput('working-directory');
const xcode = core.getInput('xcode');
const xcodeArchivePath = core.getInput('xcode_archive_path');
const execArgs = [];
execArgs.push('-n', `${name}`, '-Q', `github-action-${package_namespaceObject.i8}`);
const options = {};
@@ -19496,6 +19498,10 @@ const buildExec = () => {
if (workingDir) {
options.cwd = workingDir;
}
if (xcode && xcodeArchivePath) {
execArgs.push('--xc');
execArgs.push('--xp', `${xcodeArchivePath}`);
}
if (uploaderVersion == '') {
uploaderVersion = 'latest';
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "codecov-action",
"version": "3.0.0",
"version": "3.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "codecov-action",
"version": "3.0.0",
"version": "3.1.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",

View File

@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "3.0.0",
"version": "3.1.0",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {

View File

@@ -53,6 +53,8 @@ test('all arguments', () => {
'url': 'https://codecov.enterprise.com',
'verbose': 't',
'working-directory': 'src',
'xcode': 'true',
'xcode_archive_path': '/test.xcresult',
};
for (const env of Object.keys(envs)) {
@@ -110,6 +112,9 @@ test('all arguments', () => {
'-u',
'https://codecov.enterprise.com',
'-v',
'--xc',
'--xp',
'/test.xcresult',
]);
expect(failCi).toBeTruthy();

View File

@@ -45,6 +45,8 @@ const buildExec = () => {
const url = core.getInput('url');
const verbose = isTrue(core.getInput('verbose'));
const workingDir = core.getInput('working-directory');
const xcode = core.getInput('xcode');
const xcodeArchivePath = core.getInput('xcode_archive_path');
const execArgs = [];
execArgs.push(
@@ -165,6 +167,10 @@ const buildExec = () => {
if (workingDir) {
options.cwd = workingDir;
}
if (xcode && xcodeArchivePath) {
execArgs.push('--xc');
execArgs.push('--xp', `${xcodeArchivePath}`);
}
if (uploaderVersion == '') {
uploaderVersion = 'latest';

View File

@@ -12,7 +12,11 @@ import {
setFailure,
} from './helpers';
const verify = async (filename: string, platform: string, version: string) => {
const verify = async (
filename: string,
platform: string,
version: string,
): Promise<void> => {
try {
const uploaderName = getUploaderName(platform);

View File

@@ -1,7 +1,10 @@
import * as core from '@actions/core';
import * as fetch from 'node-fetch';
const versionInfo = async (platform: string, version?: string) => {
const versionInfo = async (
platform: string,
version?: string,
): Promise<void> => {
if (version) {
core.info(`==> Running version ${version}`);
}