Skip to content

Commit 31e8210

Browse files
Merge pull request #26 from maxim-lobanov/mlobanov/bump-node-workflow
Bump Node.js version in workflow
2 parents 4e840f5 + c39cc02 commit 31e8210

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/checkout@v2
3333

3434
- name: Remove pre-installed version
35-
run: gem uninstall cocoapods --all --executables
35+
run: gem uninstall cocoapods --all --executables --ignore-dependencies
3636

3737
- name: setup-cocoapods
3838
uses: ./
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/checkout@v2
5151

5252
- name: Remove pre-installed version
53-
run: gem uninstall cocoapods --all --executables
53+
run: gem uninstall cocoapods --all --executables --ignore-dependencies
5454

5555
- name: Install needed version
5656
run: gem install cocoapods -v 1.9.1

.github/workflows/workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set Node.JS
1919
uses: actions/setup-node@master
2020
with:
21-
node-version: 12.x
21+
node-version: 16.x
2222

2323
- name: npm install
2424
run: npm install

__tests__/installer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("CocoapodsInstaller", () => {
1919
it("replace existing version", async () => {
2020
CocoapodsInstaller["getInstalledVersion"] = jest.fn().mockReturnValue("1.8.5");
2121
await CocoapodsInstaller.install("1.9.1");
22-
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String)]);
22+
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
2323
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["install", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
2424
});
2525

__tests__/podfile-parser.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ describe("getVersionFromPodfile", () => {
66
["Podfile.lock", "1.5.3"],
77
["Podfile2.lock", "1.9.3"],
88
["Podfile3.lock", "1.10.0.rc.1"],
9-
["Podfile4.lock", "1.9.0.beta.2"],
10-
["Podfile5.lock", null]
9+
["Podfile4.lock", "1.9.0.beta.2"]
1110
])("test case %#", (input: string, expected: string | null) => {
1211
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", input));
13-
if (expected) {
14-
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
15-
} else {
16-
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
17-
}
12+
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
13+
});
14+
15+
it("fails on invalid podfile", () => {
16+
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", "Podfile5.lock"));
17+
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
1818
});
1919
});
2020

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CocoapodsInstaller {
4242
return;
4343
}
4444
// Remove pre-installed version of Cocoapods
45-
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
45+
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables", "--ignore-dependencies"]);
4646
// Install new version of Cocoapods
4747
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];
4848
await exec.exec("gem", ["install", "cocoapods", ...versionArguments, "--no-document"]);

src/installer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CocoapodsInstaller {
1212
}
1313

1414
// Remove pre-installed version of Cocoapods
15-
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
15+
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables", "--ignore-dependencies"]);
1616

1717
// Install new version of Cocoapods
1818
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];

0 commit comments

Comments
 (0)