Compare commits

...

9 Commits

Author SHA1 Message Date
Vipul 01b0229624 Generate dist 2022-06-26 14:50:51 +00:00
Álvaro Mondéjar Rubio c4678ef19f Fix linting 2022-06-21 13:42:12 +02:00
Álvaro Mondéjar Rubio fe28a720e4 Fix prettier error 2022-06-21 13:33:41 +02:00
Álvaro Mondéjar Rubio 84dee78cdb EMpty commit to rerun CI 2022-06-21 10:06:36 +02:00
Álvaro Mondéjar Rubio bd9fe45728 Empty commit tu rerun workflow 2022-02-22 12:37:06 +01:00
Álvaro Mondéjar e9d6e93306 Double check if CI is failing properly 2020-11-28 20:45:38 +01:00
Álvaro Mondéjar a89dcfa06d Update dist folder 2020-11-28 20:39:41 +01:00
Álvaro Mondéjar 114965806a Fix lint issue 2020-11-28 20:37:09 +01:00
Álvaro Mondéjar 2bdaf00273 Sort inputs and remove whitespaces after exclamation at the beginning of lines 2020-11-28 20:34:06 +01:00
5 changed files with 50509 additions and 45359 deletions

View File

@ -213,6 +213,39 @@ test("getInputAsArray handles empty lines correctly", () => {
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]); expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
}); });
test("getInputAsArray sorts files correctly", () => {
testUtils.setInput(
"foo",
"bar\n!baz\nwaldo\nqux\nquux\ncorge\ngrault\ngarply"
);
expect(actionUtils.getInputAsArray("foo")).toEqual([
"!baz",
"bar",
"corge",
"garply",
"grault",
"quux",
"qux",
"waldo"
]);
});
test("getInputAsArray removes spaces after ! at the beginning", () => {
testUtils.setInput(
"foo",
"! bar\n! baz\n! qux\n!quux\ncorge\ngrault! garply\n!\r\t waldo"
);
expect(actionUtils.getInputAsArray("foo")).toEqual([
"!bar",
"!baz",
"!quux",
"!qux",
"!waldo",
"corge",
"grault! garply"
]);
});
test("getInputAsInt returns undefined if input not set", () => { test("getInputAsInt returns undefined if input not set", () => {
expect(actionUtils.getInputAsInt("undefined")).toBeUndefined(); expect(actionUtils.getInputAsInt("undefined")).toBeUndefined();
}); });

View File

@ -97,7 +97,7 @@ test("restore with no key", async () => {
test("restore with too many keys should fail", async () => { test("restore with too many keys should fail", async () => {
const path = "node_modules"; const path = "node_modules";
const key = "node-test"; const key = "node-test";
const restoreKeys = [...Array(20).keys()].map(x => x.toString()); const restoreKeys = [...Array(20).keys()].map(x => x.toString()).sort();
testUtils.setInputs({ testUtils.setInputs({
path: path, path: path,
key, key,

45010
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

45010
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -60,8 +60,9 @@ export function getInputAsArray(
return core return core
.getInput(name, options) .getInput(name, options)
.split("\n") .split("\n")
.map(s => s.trim()) .map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== ""); .filter(x => x !== "")
.sort();
} }
export function getInputAsInt( export function getInputAsInt(