feat: add xcode support

This commit is contained in:
Tom Hu
2022-04-21 10:12:03 -04:00
parent 6a6a9ae7b1
commit a03184e530
12 changed files with 54 additions and 12 deletions

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}`);
}