Skip to content

Commit

Permalink
Merge pull request #26 from maxim-lobanov/mlobanov/bump-node-workflow
Browse files Browse the repository at this point in the history
Bump Node.js version in workflow
  • Loading branch information
maxim-lobanov committed Nov 6, 2022
2 parents 4e840f5 + c39cc02 commit 31e8210
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v2

- name: Remove pre-installed version
run: gem uninstall cocoapods --all --executables
run: gem uninstall cocoapods --all --executables --ignore-dependencies

- name: setup-cocoapods
uses: ./
Expand All @@ -50,7 +50,7 @@ jobs:
uses: actions/checkout@v2

- name: Remove pre-installed version
run: gem uninstall cocoapods --all --executables
run: gem uninstall cocoapods --all --executables --ignore-dependencies

- name: Install needed version
run: gem install cocoapods -v 1.9.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set Node.JS
uses: actions/setup-node@master
with:
node-version: 12.x
node-version: 16.x

- name: npm install
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("CocoapodsInstaller", () => {
it("replace existing version", async () => {
CocoapodsInstaller["getInstalledVersion"] = jest.fn().mockReturnValue("1.8.5");
await CocoapodsInstaller.install("1.9.1");
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String)]);
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["install", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
});

Expand Down
14 changes: 7 additions & 7 deletions __tests__/podfile-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ describe("getVersionFromPodfile", () => {
["Podfile.lock", "1.5.3"],
["Podfile2.lock", "1.9.3"],
["Podfile3.lock", "1.10.0.rc.1"],
["Podfile4.lock", "1.9.0.beta.2"],
["Podfile5.lock", null]
["Podfile4.lock", "1.9.0.beta.2"]
])("test case %#", (input: string, expected: string | null) => {
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", input));
if (expected) {
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
} else {
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
}
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
});

it("fails on invalid podfile", () => {
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", "Podfile5.lock"));
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
});
});

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CocoapodsInstaller {
return;
}
// Remove pre-installed version of Cocoapods
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables", "--ignore-dependencies"]);
// Install new version of Cocoapods
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];
await exec.exec("gem", ["install", "cocoapods", ...versionArguments, "--no-document"]);
Expand Down
2 changes: 1 addition & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class CocoapodsInstaller {
}

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

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

0 comments on commit 31e8210

Please sign in to comment.