Skip to content

Commit 79321a3

Browse files
author
Maxim Lobanov
committed
add build workflow
1 parent 1b26f37 commit 79321a3

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

.github/workflows/workflow.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build task
2+
on: [pull_request]
3+
4+
jobs:
5+
Build:
6+
runs-on: macos-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@master
10+
11+
- name: Set Node.JS
12+
uses: actions/setup-node@master
13+
with:
14+
node-version: 12.x
15+
16+
- name: npm install
17+
run: npm install
18+
19+
- name: Build
20+
run: npm run build
21+
22+
- name: Run tests
23+
run: npm run test
24+
25+
- name: Lint
26+
run: npm run lint

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ inputs:
66
description: 'Version of Cocoapods to install'
77
required: false
88
podfile-path:
9-
description: 'Path to Podfile.lock file to determine cocoapods version'
9+
description: 'Path to Podfile.lock file to determine Cocoapods version'
1010
required: false
1111
runs:
1212
using: 'node12'
1313
main: 'dist/index.js'
1414
branding:
1515
icon: 'code'
16-
color: 'yellow'
16+
color: 'purple'

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,15 +1509,15 @@ class CocoapodsInstaller {
15091509
// Checking pre-installed version of Cocoapods
15101510
const installedVersion = await this.getInstalledVersion();
15111511
if (installedVersion === versionSpec) {
1512-
core.info(`Cocoapods ${versionSpec} has already installed. Not needed to re-install.`);
1512+
core.info(`Cocoapods ${versionSpec} has already been installed. No need to re-install.`);
15131513
return;
15141514
}
15151515
// Remove pre-installed version of Cocoapods
15161516
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
15171517
// Install new version of Cocoapods
15181518
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];
15191519
await exec.exec("gem", ["install", "cocoapods", ...versionArguments]);
1520-
core.info(`Cocoapods ${versionSpec} has installed successfully`);
1520+
core.info(`Cocoapods ${versionSpec} has been installed successfully`);
15211521
}
15221522
static getVersionFromPodfile(podfilePath) {
15231523
const absolutePath = path.resolve(podfilePath);
@@ -1572,7 +1572,7 @@ const run = async () => {
15721572
const versionInput = core.getInput("version", { required: false });
15731573
const podfilePathInput = core.getInput("podfile-path", { required: false });
15741574
if (!!versionInput === !!podfilePathInput) {
1575-
throw new Error("Invalid input parameters. Only 'version' or 'podfile-path' should be defined");
1575+
throw new Error("Invalid input parameters usage. Only 'version' or 'podfile-path' should be defined");
15761576
}
15771577
const versionSpec = versionInput; // || CocoapodsInstaller.getVersionFromPodfile(podfilePathInput);
15781578
if (!versionSpec) {

src/installer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class CocoapodsInstaller {
1010
// Checking pre-installed version of Cocoapods
1111
const installedVersion = await this.getInstalledVersion();
1212
if (installedVersion === versionSpec) {
13-
core.info(`Cocoapods ${versionSpec} has already installed. Not needed to re-install.`);
13+
core.info(`Cocoapods ${versionSpec} has already been installed. No need to re-install.`);
1414
return;
1515
}
1616

@@ -21,7 +21,7 @@ export class CocoapodsInstaller {
2121
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];
2222
await exec.exec("gem", ["install", "cocoapods", ...versionArguments]);
2323

24-
core.info(`Cocoapods ${versionSpec} has installed successfully`);
24+
core.info(`Cocoapods ${versionSpec} has been installed successfully`);
2525
}
2626

2727
public static getVersionFromPodfile(podfilePath: string): string {

src/setup-cocoapods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const run = async (): Promise<void> => {
1111
const podfilePathInput = core.getInput("podfile-path", { required: false });
1212

1313
if (!!versionInput === !!podfilePathInput) {
14-
throw new Error("Invalid input parameters. Only 'version' or 'podfile-path' should be defined");
14+
throw new Error("Invalid input parameters usage. Only 'version' or 'podfile-path' should be defined");
1515
}
1616

1717
const versionSpec = versionInput;// || CocoapodsInstaller.getVersionFromPodfile(podfilePathInput);

0 commit comments

Comments
 (0)