From 8dccd27a4c8371eb11e1433f9c52a25e21d6a42c Mon Sep 17 00:00:00 2001 From: Arindam Bose Date: Fri, 8 Oct 2021 12:02:33 -0700 Subject: [PATCH 1/2] backport mbx CI changes to v1 --- .circleci/config.yml | 57 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eee41c49067..2ce74d30484 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,18 @@ workflows: filters: tags: only: /.*/ + - install-mbx-ci: + requires: + - prepare + filters: + tags: + only: /.*/ + # We can't install mbx-ci on CI runs from PR's that reference forks from external contributors + # This is because fork's can not access our AWS credentials setup in CircleCI environment variables + # Branch names for external contributor forks are are reported in the format pull/{PR_NUMBER} to CircleCI, + # This RegEx is setup to ignore that. + branches: + ignore: /pull\/[0-9]*/ - lint: requires: - prepare @@ -25,6 +37,7 @@ workflows: - check-size: requires: - build + - install-mbx-ci filters: tags: only: /.*/ @@ -76,6 +89,7 @@ workflows: requires: - lint - build + - install-mbx-ci - test-flow - test-unit - test-render @@ -92,6 +106,7 @@ workflows: requires: - lint - build + - install-mbx-ci - test-flow - test-unit - test-render @@ -123,9 +138,10 @@ jobs: - '~/.yarn' - 'node_modules' - persist_to_workspace: - root: . + root: ~/ paths: - - . + - mapbox-gl-js + - .ssh lint: <<: *defaults @@ -178,7 +194,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: name: Check bundle size command: | @@ -189,7 +205,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: name: Collect performance stats command: node bench/gl-stats.js @@ -202,21 +218,21 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run test-flow test-unit: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run test-unit test-render: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run test-render - store_artifacts: path: "test/integration/render-tests/index.html" @@ -225,7 +241,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run test-query - store_test_results: path: test/integration/query-tests @@ -236,7 +252,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run build-dev - run: yarn run build-token - run: @@ -256,14 +272,31 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run test-expressions + install-mbx-ci: + <<: *defaults + steps: + - run: + name: Install mbx-ci + command: | + curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > ~/mbx-ci && + chmod 755 ~/mbx-ci && + ~/mbx-ci aws setup + # mbx-ci stores credentials in these directories, so they must be explictly passed along to dependent jobs via workspaces + - persist_to_workspace: + root: ~/ + paths: + - .ssh + - .aws + - mbx-ci + deploy-benchmarks: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: name: Build command: BENCHMARK_VERSION="${CIRCLE_TAG:-$CIRCLE_BRANCH} $(git rev-parse --short=7 HEAD)" yarn run build-benchmarks @@ -279,7 +312,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - aws-cli/install - run: name: Deploy release From b1a6371d82e37f004e9c26f695abf860fdc7059e Mon Sep 17 00:00:00 2001 From: Arindam Bose Date: Fri, 8 Oct 2021 12:12:02 -0700 Subject: [PATCH 2/2] Fix few missing things --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ce74d30484..0abba8d4843 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -147,7 +147,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - restore_cache: keys: - v2-lint-{{ .Branch }} @@ -164,7 +164,7 @@ jobs: <<: *defaults steps: - attach_workspace: - at: . + at: ~/ - run: yarn run build-prod-min - run: yarn run build-prod - run: yarn run build-csp @@ -186,9 +186,9 @@ jobs: - store_artifacts: path: "test/release" - persist_to_workspace: - root: . + root: ~/ paths: - - dist + - mapbox-gl-js/dist check-size: <<: *defaults