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

feat: add xcode support #699

Merged
merged 1 commit into from Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -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
Expand Down
11 changes: 7 additions & 4 deletions README.md
Expand Up @@ -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
Expand All @@ -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

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js
Expand Up @@ -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


Expand Down Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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';
}
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 dist/sourcemap-register.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions src/buildExec.test.ts
Expand Up @@ -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)) {
Expand Down Expand Up @@ -110,6 +112,9 @@ test('all arguments', () => {
'-u',
'https://codecov.enterprise.com',
'-v',
'--xc',
'--xp',
'/test.xcresult',
]);
expect(failCi).toBeTruthy();

Expand Down
6 changes: 6 additions & 0 deletions src/buildExec.ts
Expand Up @@ -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(
Expand Down Expand Up @@ -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';
Expand Down
6 changes: 5 additions & 1 deletion src/validate.ts
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion src/version.ts
@@ -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}`);
}
Expand Down