Skip to content

Commit

Permalink
Merge pull request softprops#34 from softprops/release-prep
Browse files Browse the repository at this point in the history
release prep
  • Loading branch information
softprops authored Dec 24, 2020
2 parents f231d5d + d0d554c commit 8945151
Show file tree
Hide file tree
Showing 10 changed files with 1,202 additions and 1,003 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## unreleased
## 0.1.5

* Added feature to set the output `force_continued=true` when using `continue-after-seconds` so that only a subset of future steps can be skipped.

Expand Down
18 changes: 9 additions & 9 deletions __tests__/input.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("input", () => {
GITHUB_RUN_ID: "1",
"INPUT_CONTINUE-AFTER-SECONDS": "10",
"INPUT_POLL-INTERVAL-SECONDS": "5",
"INPUT_SAME-BRANCH-ONLY": "false"
"INPUT_SAME-BRANCH-ONLY": "false",
}),
{
githubToken: "s3cr3t",
Expand All @@ -25,7 +25,7 @@ describe("input", () => {
continueAfterSeconds: 10,
abortAfterSeconds: undefined,
pollIntervalSeconds: 5,
sameBranchOnly: false
sameBranchOnly: false,
}
);
});
Expand All @@ -40,7 +40,7 @@ describe("input", () => {
GITHUB_RUN_ID: "1",
"INPUT_ABORT-AFTER-SECONDS": "10",
"INPUT_POLL-INTERVAL-SECONDS": "5",
"INPUT_SAME-BRANCH-ONLY": "false"
"INPUT_SAME-BRANCH-ONLY": "false",
}),
{
githubToken: "s3cr3t",
Expand All @@ -52,7 +52,7 @@ describe("input", () => {
continueAfterSeconds: undefined,
abortAfterSeconds: 10,
pollIntervalSeconds: 5,
sameBranchOnly: false
sameBranchOnly: false,
}
);
});
Expand All @@ -66,7 +66,7 @@ describe("input", () => {
GITHUB_WORKFLOW: "test",
GITHUB_RUN_ID: "1",
"INPUT_CONTINUE-AFTER-SECONDS": "10",
"INPUT_ABORT-AFTER-SECONDS": "2"
"INPUT_ABORT-AFTER-SECONDS": "2",
})
);
});
Expand All @@ -81,7 +81,7 @@ describe("input", () => {
GITHUB_RUN_ID: "1",
"INPUT_CONTINUE-AFTER-SECONDS": "",
"INPUT_POLL-INTERVAL-SECONDS": "",
"INPUT_SAME-BRANCH-ONLY": ""
"INPUT_SAME-BRANCH-ONLY": "",
}),
{
githubToken: "s3cr3t",
Expand All @@ -93,7 +93,7 @@ describe("input", () => {
continueAfterSeconds: undefined,
abortAfterSeconds: undefined,
pollIntervalSeconds: 60,
sameBranchOnly: true
sameBranchOnly: true,
}
);
});
Expand All @@ -106,7 +106,7 @@ describe("input", () => {
GITHUB_REF: "refs/heads/foo",
GITHUB_REPOSITORY: "softprops/turnstyle",
GITHUB_WORKFLOW: "test",
GITHUB_RUN_ID: "1"
GITHUB_RUN_ID: "1",
}),
{
githubToken: "s3cr3t",
Expand All @@ -118,7 +118,7 @@ describe("input", () => {
continueAfterSeconds: undefined,
abortAfterSeconds: undefined,
pollIntervalSeconds: 60,
sameBranchOnly: true
sameBranchOnly: true,
}
);
});
Expand Down
34 changes: 17 additions & 17 deletions __tests__/wait.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("wait", () => {
let input: Input;
const workflow: Workflow = {
id: 123124,
name: "Test workflow"
name: "Test workflow",
};

beforeEach(() => {
Expand All @@ -24,7 +24,7 @@ describe("wait", () => {
repo: "repo",
runId: 2,
workflowName: workflow.name,
sameBranchOnly: true
sameBranchOnly: true,
};
});

Expand All @@ -33,7 +33,7 @@ describe("wait", () => {
const inProgressRun = {
id: 1,
status: "in_progress",
html_url: ""
html_url: "",
};
const githubClient = {
runs: async (
Expand All @@ -43,7 +43,7 @@ describe("wait", () => {
workflowId: number
) => Promise.resolve([inProgressRun]),
workflows: async (owner: string, repo: string) =>
Promise.resolve([workflow])
Promise.resolve([workflow]),
};

const messages: Array<string> = [];
Expand All @@ -58,7 +58,7 @@ describe("wait", () => {
assert.equal(await waiter.wait(), 1);
assert.deepEqual(messages, [
"✋Awaiting run ...",
"🤙Exceeded wait seconds. Continuing..."
"🤙Exceeded wait seconds. Continuing...",
]);
});

Expand All @@ -67,7 +67,7 @@ describe("wait", () => {
const inProgressRun = {
id: 1,
status: "in_progress",
html_url: ""
html_url: "",
};
const githubClient = {
runs: async (
Expand All @@ -77,7 +77,7 @@ describe("wait", () => {
workflowId: number
) => Promise.resolve([inProgressRun]),
workflows: async (owner: string, repo: string) =>
Promise.resolve([workflow])
Promise.resolve([workflow]),
};

const messages: Array<string> = [];
Expand All @@ -91,19 +91,19 @@ describe("wait", () => {
);
await assert.rejects(waiter.wait(), {
name: "Error",
message: "Aborted after waiting 1 seconds"
message: "Aborted after waiting 1 seconds",
});
assert.deepEqual(messages, [
"✋Awaiting run ...",
"🛑Exceeded wait seconds. Aborting..."
"🛑Exceeded wait seconds. Aborting...",
]);
});

it("will return when a run is completed", async () => {
const run: Run = {
id: 1,
status: "in_progress",
html_url: "1"
html_url: "1",
};

const mockedRunsFunc = jest
Expand All @@ -113,7 +113,7 @@ describe("wait", () => {
const githubClient = {
runs: mockedRunsFunc,
workflows: async (owner: string, repo: string) =>
Promise.resolve([workflow])
Promise.resolve([workflow]),
};

const messages: Array<string> = [];
Expand All @@ -134,18 +134,18 @@ describe("wait", () => {
{
id: 1,
status: "in_progress",
html_url: "1"
html_url: "1",
},
{
id: 2,
status: "in_progress",
html_url: "2"
html_url: "2",
},
{
id: 3,
status: "in_progress",
html_url: "3"
}
html_url: "3",
},
];
// Give the current run an id that makes it the last in the queue.
input.runId = inProgressRuns.length + 1;
Expand All @@ -154,7 +154,7 @@ describe("wait", () => {
inProgressRuns.push({
id: input.runId + 1,
status: "in_progress",
html_url: input.runId + 1 + ""
html_url: input.runId + 1 + "",
});

const mockedRunsFunc = jest.fn();
Expand All @@ -171,7 +171,7 @@ describe("wait", () => {
runs: mockedRunsFunc,
run: jest.fn(),
workflows: async (owner: string, repo: string) =>
Promise.resolve([workflow])
Promise.resolve([workflow]),
};

const messages: Array<string> = [];
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8945151

Please sign in to comment.