Skip to content

Commit

Permalink
Merge pull request #1 from meisterplan/feature/KNUTH-84114-set-output…
Browse files Browse the repository at this point in the history
…--node12-meisterpl

KNUTH-84114 [set-output & node12] meisterplan/action-turnstyle entforken/updaten
  • Loading branch information
xcq1 authored May 12, 2023
2 parents 932a73d + 31730aa commit f231aa5
Show file tree
Hide file tree
Showing 10 changed files with 6,187 additions and 4,005 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__tests__/runner/*
node_modules
coverage
coverage
.idea/
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.14.1
16.20.0
29 changes: 17 additions & 12 deletions __tests__/wait.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("wait", () => {
const inProgressRun = {
id: 1,
status: "in_progress",
html_url: "",
html_url: "https://run.test",
};
const githubClient = {
runs: async (
Expand All @@ -57,8 +57,8 @@ describe("wait", () => {
);
assert.equal(await waiter.wait(), 1);
assert.deepEqual(messages, [
"✋Awaiting run ...",
"🤙Exceeded wait seconds. Continuing...",
"✋ 1 uncompleted runs. Awaiting run https://run.test to complete (currently in_progress)...",
"🤙 Exceeded wait seconds. Continuing...",
]);
});

Expand All @@ -67,7 +67,7 @@ describe("wait", () => {
const inProgressRun = {
id: 1,
status: "in_progress",
html_url: "",
html_url: "https://run.test",
};
const githubClient = {
runs: async (
Expand All @@ -94,16 +94,16 @@ describe("wait", () => {
message: "Aborted after waiting 1 seconds",
});
assert.deepEqual(messages, [
"✋Awaiting run ...",
"🛑Exceeded wait seconds. Aborting...",
"✋ 1 uncompleted runs. Awaiting run https://run.test to complete (currently in_progress)...",
"🛑 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: "https://run.test",
};

const mockedRunsFunc = jest
Expand All @@ -126,7 +126,10 @@ describe("wait", () => {
}
);
await waiter.wait();
assert.deepEqual(messages, ["✋Awaiting run 1 ..."]);
assert.deepEqual(messages, [
"✋ 1 uncompleted runs. Awaiting run https://run.test to complete (currently in_progress)...",
"✅ No uncompleted runs. Continuing...",
]);
});

it("will wait for all previous runs", async () => {
Expand Down Expand Up @@ -187,10 +190,12 @@ describe("wait", () => {
// Verify that the last message printed is that the latest previous run
// is complete and not the oldest one.
const latestPreviousRun = inProgressRuns[inProgressRuns.length - 1];
assert.deepEqual(
messages[messages.length - 1],
`✋Awaiting run ${input.runId - 1} ...`
);
assert.deepEqual(messages.slice(messages.length - 2), [
`✋ 3 uncompleted runs. Awaiting run ${
input.runId - 1
} to complete (currently in_progress)...`,
"✅ No uncompleted runs. Continuing...",
]);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'action turnstyle'
description: 'A GitHub Action for serializing workflow runs'
author: 'softprops'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
inputs:
poll-interval-seconds:
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit f231aa5

Please sign in to comment.