From 5536384866eb72aa61500fcbd844b61c0b7a00d3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:21:28 +0000 Subject: [PATCH 1/6] Do less unnecessary work on CI We were checking out & installing the develop js-sdk explicitly in cases where we didn't need it at all. We were babeling the src folder many, many times over (in some cases twice in the same job) and never using the output at all. --- .buildkite/pipeline.yaml | 43 ++++++++++++++------------------------ scripts/ci/install-deps.sh | 4 ++-- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 1e08d2cd3b..39bba6637a 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -2,7 +2,8 @@ steps: - label: ":eslint: JS Lint" command: - "echo '--- Install js-sdk'" - - "./scripts/ci/install-deps.sh" + - "./scripts/ci/install-deps.sh --ignore-scripts" + - "echo '+++ Lint" - "yarn lint:js" plugins: - docker#v3.0.1: @@ -10,8 +11,9 @@ steps: - label: ":eslint: TS Lint" command: - - "echo '--- Install js-sdk'" - - "./scripts/ci/install-deps.sh" + - "echo '--- Install" + - "yarn install --ignore-scripts" + - "echo '+++ Lint" - "yarn lint:ts" plugins: - docker#v3.0.1: @@ -19,8 +21,9 @@ steps: - label: ":eslint: Types Lint" command: - - "echo '--- Install js-sdk'" - - "./scripts/ci/install-deps.sh" + - "echo '--- Install" + - "yarn install --ignore-scripts" + - "echo '+++ Lint" - "yarn lint:types" plugins: - docker#v3.0.1: @@ -41,13 +44,10 @@ steps: queue: "medium" command: - "echo '--- Install js-sdk'" - # TODO: Remove hacky chmod for BuildKite - - "chmod +x ./scripts/ci/*.sh" - - "chmod +x ./scripts/*" - - "echo '--- Installing Dependencies'" - - "./scripts/ci/install-deps.sh" - - "echo '--- Running initial build steps'" - - "yarn build" + # We don't use the babel-ed output for anything so we can --ignore-scripts + # to save transpiling the files. We run the transpile step explicitly in + # the 'build' job. + - "./scripts/ci/install-deps.sh --ignore-scripts" - "echo '+++ Running Tests'" - "yarn test" plugins: @@ -56,10 +56,8 @@ steps: - label: "🛠 Build" command: - - "echo '--- Install js-sdk'" - - "./scripts/ci/install-deps.sh" - - "echo '+++ Building Project'" - - "yarn build" + - "echo '+++ Install & Build'" + - "yarn install" plugins: - docker#v3.0.1: image: "node:12" @@ -70,14 +68,8 @@ steps: # e2e tests otherwise take +-8min queue: "xlarge" command: - # TODO: Remove hacky chmod for BuildKite - - "echo '--- Setup'" - - "chmod +x ./scripts/ci/*.sh" - - "chmod +x ./scripts/*" - "echo '--- Install js-sdk'" - - "./scripts/ci/install-deps.sh" - - "echo '--- Running initial build steps'" - - "yarn build" + - "./scripts/ci/install-deps.sh --ignore-scripts" - "echo '+++ Running Tests'" - "./scripts/ci/end-to-end-tests.sh" plugins: @@ -96,9 +88,6 @@ steps: # webpack loves to gorge itself on resources. queue: "medium" command: - # TODO: Remove hacky chmod for BuildKite - - "chmod +x ./scripts/ci/*.sh" - - "chmod +x ./scripts/*" - "echo '+++ Running Tests'" - "./scripts/ci/riot-unit-tests.sh" plugins: @@ -110,7 +99,7 @@ steps: - label: "🌐 i18n" command: - "echo '--- Fetching Dependencies'" - - "yarn install" + - "yarn install --ignore-scripts" - "echo '+++ Testing i18n output'" - "yarn diff-i18n" plugins: diff --git a/scripts/ci/install-deps.sh b/scripts/ci/install-deps.sh index a2e2e59a45..14b5fc5393 100755 --- a/scripts/ci/install-deps.sh +++ b/scripts/ci/install-deps.sh @@ -6,9 +6,9 @@ scripts/fetchdep.sh matrix-org matrix-js-sdk pushd matrix-js-sdk yarn link -yarn install +yarn install $@ yarn build popd yarn link matrix-js-sdk -yarn install +yarn install $@ From 57ee99d6f797115d051914d8513b262ca50441e2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:30:41 +0000 Subject: [PATCH 2/6] chmod --- scripts/ci/layered-riot-web.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/ci/layered-riot-web.sh diff --git a/scripts/ci/layered-riot-web.sh b/scripts/ci/layered-riot-web.sh old mode 100644 new mode 100755 From 19c49eedec75ce21e7ecc982ec209b6b4203b2bc Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:36:12 +0000 Subject: [PATCH 3/6] reskindex for tests --- .buildkite/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 39bba6637a..7dbb959dea 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -48,6 +48,7 @@ steps: # to save transpiling the files. We run the transpile step explicitly in # the 'build' job. - "./scripts/ci/install-deps.sh --ignore-scripts" + - "yarn run reskindex" - "echo '+++ Running Tests'" - "yarn test" plugins: From de5c47960c8a34f7412dcf0c836349348378e65a Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:51:11 +0000 Subject: [PATCH 4/6] quotes --- .buildkite/pipeline.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 7dbb959dea..698ce43c93 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -3,7 +3,7 @@ steps: command: - "echo '--- Install js-sdk'" - "./scripts/ci/install-deps.sh --ignore-scripts" - - "echo '+++ Lint" + - "echo '+++ Lint'" - "yarn lint:js" plugins: - docker#v3.0.1: @@ -13,7 +13,7 @@ steps: command: - "echo '--- Install" - "yarn install --ignore-scripts" - - "echo '+++ Lint" + - "echo '+++ Lint'" - "yarn lint:ts" plugins: - docker#v3.0.1: @@ -21,9 +21,9 @@ steps: - label: ":eslint: Types Lint" command: - - "echo '--- Install" + - "echo '--- Install'" - "yarn install --ignore-scripts" - - "echo '+++ Lint" + - "echo '+++ Lint'" - "yarn lint:types" plugins: - docker#v3.0.1: From b17f38856ca5f49efe593aa92755583cdc5058c9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:56:00 +0000 Subject: [PATCH 5/6] More quote failing --- .buildkite/pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 698ce43c93..842ea091fb 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -11,7 +11,7 @@ steps: - label: ":eslint: TS Lint" command: - - "echo '--- Install" + - "echo '--- Install'" - "yarn install --ignore-scripts" - "echo '+++ Lint'" - "yarn lint:ts" From 26aaa58e3cc2c05ceeb239a753747cde6f720d34 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Jan 2020 14:58:46 +0000 Subject: [PATCH 6/6] Comments are great --- .buildkite/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 842ea091fb..4bc69a76bd 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -1,6 +1,7 @@ steps: - label: ":eslint: JS Lint" command: + # We fetch the develop js-sdk to get our latest eslint rules - "echo '--- Install js-sdk'" - "./scripts/ci/install-deps.sh --ignore-scripts" - "echo '+++ Lint'"