Skip to content

Commit

Permalink
feat: add format checking for lambdas in CI (philips-labs#899) (phili…
Browse files Browse the repository at this point in the history
…ps-labs#1080)

* feat: add fomat checking for lambdas in CI (philips-labs#899)

* FIx build issues.

- fix prettier issue
- add dependencies for the syncer module
- use same eslint in all 3 modules

* Fix prettier issue, and update the yarn.lock files
  • Loading branch information
aadrijnberg authored Aug 12, 2021
1 parent 946b2ea commit ae9c277
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lambda-runner-binaries-syncer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lambda-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lambda-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"@typescript-eslint/parser": "^4.29.1",
"@vercel/ncc": "^0.29.0",
"aws-sdk": "^2.965.0",
"eslint": "^7.24.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "3.4.0",
"jest": "^26.6.3",
"prettier": "2.3.2",
"ts-jest": "^26.5.5",
"ts-node-dev": "^1.1.6",
"typescript": "^4.3.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Synchronize action distribution.', () => {
},
};
});

await handle();
expect(mockOctokit.repos.listReleases).toBeCalledTimes(1);
expect(mockS3.getObjectTagging).toBeCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,13 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"

eslint-plugin-prettier@3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7"
integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
Expand Down Expand Up @@ -1726,7 +1733,7 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint@^7.24.0:
eslint@^7.32.0:
version "7.32.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
Expand Down Expand Up @@ -1932,6 +1939,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==

fast-glob@^3.1.1:
version "3.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
Expand Down Expand Up @@ -3561,6 +3573,18 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"

prettier@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==

pretty-format@^26.0.0, pretty-format@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"
Expand Down
2 changes: 1 addition & 1 deletion modules/runners/lambdas/runners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"@vercel/ncc": "^0.29.0",
"eslint": "^7.22.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "3.4.0",
"jest": "27.0.6",
"jest-mock-extended": "^2.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe('scaleUp with GHES', () => {
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
expect(mockOctokit.actions.createRegistrationTokenForRepo).not.toBeCalled();
});

it('creates a token when maximum runners has not been reached', async () => {
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA);
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
Expand Down Expand Up @@ -481,7 +481,7 @@ describe('scaleUp with public GH', () => {
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
expect(mockOctokit.actions.createRegistrationTokenForRepo).not.toBeCalled();
});

it('creates a token when maximum runners has not been reached', async () => {
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA);
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/lambdas/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@vercel/ncc": "0.29.0",
"aws-sdk": "^2.965.0",
"body-parser": "^1.19.0",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "3.4.0",
"express": "^4.17.1",
"jest": "^26.6.3",
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/lambdas/webhook/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,7 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint@^7.29.0:
eslint@^7.32.0:
version "7.32.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
Expand Down

0 comments on commit ae9c277

Please sign in to comment.