Skip to content

Commit

Permalink
Cleanup (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
devkeydet authored Nov 27, 2021
1 parent a07142a commit 63c0f01
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 58 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/check-dist.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ jobs:
npm install
- run: |
npm run all
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
test-action:
needs: test-code
environment: foo
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function getDeploymentsWaitingFor(octokit, context, inputs, jobId) {
.filter(status => !status.log_url.includes(jobId.toString()))
.filter(status => new Date(status.created_at) < new Date(currentDeploymentStatus.created_at));
}
core.info(`found ${waitingFor.length} statuses to wait for`);
core.info(`found ${waitingFor.length} deployments to wait for`);
core.debug(util.inspect(waitingFor.map(status => ({ id: status.id, name: status.state }))));
return waitingFor;
});
Expand Down Expand Up @@ -205,6 +205,8 @@ function queueWorkflow(inputs) {
});
}
exports.queueWorkflow = queueWorkflow;
function someName(params) {
}


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion lib/getDeploymentsWaitingFor.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getDeploymentsWaitingFor(octokit, context, inputs, jobId) {
.filter(status => !status.log_url.includes(jobId.toString()))
.filter(status => new Date(status.created_at) < new Date(currentDeploymentStatus.created_at));
}
core.info(`found ${waitingFor.length} statuses to wait for`);
core.info(`found ${waitingFor.length} deployments to wait for`);
core.debug(util.inspect(waitingFor.map(status => ({ id: status.id, name: status.state }))));
return waitingFor;
});
Expand Down
2 changes: 2 additions & 0 deletions lib/queueWorkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ function queueWorkflow(inputs) {
});
}
exports.queueWorkflow = queueWorkflow;
function someName(params) {
}
2 changes: 1 addition & 1 deletion src/getDeploymentsWaitingFor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function getDeploymentsWaitingFor(octokit: Octokit, context: Contex
.filter(status => new Date(status.created_at) < new Date(currentDeploymentStatus.created_at))
}

core.info(`found ${waitingFor.length} statuses to wait for`)
core.info(`found ${waitingFor.length} deployments to wait for`)
core.debug(util.inspect(waitingFor.map(status => ({ id: status.id, name: status.state }))))

return waitingFor
Expand Down
4 changes: 3 additions & 1 deletion src/queueWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ export async function queueWorkflow(inputs: Inputs) {
core.info(latestQueueStatus);
}


function someName(params:string) {

}
6 changes: 3 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test('queueWorkflow: nothing to queue', async () => {

let msg = ''
jest.spyOn(core, 'info').mockImplementation((messsage: string) => {
// eat the cals so they don't show up in the test results on the runner
// spy on the calls so they don't show up in the test results on the runner
})

let mockExit = mockProcess.mockProcessExit()
Expand Down Expand Up @@ -127,7 +127,7 @@ test('queueWorkflow: deployments to queue', async () => {
}

jest.spyOn(core, 'info').mockImplementation(() => {
// eat the cals so they don't show up in the test results on the runner
// spy on the calls so they don't show up in the test results on the runner
})

// @ts-ignore
Expand Down Expand Up @@ -202,7 +202,7 @@ test('queueWorkflow: timed out', async () => {
})
let mockExit = mockProcess.mockProcessExit()
jest.spyOn(core, 'setFailed').mockImplementation((messsage: any) => {
// eat the cals so they don't show up in the test results on the runner
// spy on the calls so they don't show up in the test results on the runner
})
await queueWorkflow(inputs)
expect(mockExit).toHaveBeenCalledWith(1)
Expand Down

0 comments on commit 63c0f01

Please sign in to comment.