1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #5090 from whymarrh/fix-ci

Update CircleCI configuration to use workspaces instead of caches
This commit is contained in:
kumavis 2018-08-17 16:31:32 -07:00 committed by GitHub
commit fb5faec372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 151 deletions

View File

@ -5,7 +5,6 @@ workflows:
full_test: full_test:
jobs: jobs:
- prep-deps-npm - prep-deps-npm
- prep-deps-firefox
- prep-build: - prep-build:
requires: requires:
- prep-deps-npm - prep-deps-npm
@ -28,7 +27,6 @@ workflows:
- test-e2e-firefox: - test-e2e-firefox:
requires: requires:
- prep-deps-npm - prep-deps-npm
- prep-deps-firefox
- prep-build - prep-build
- test-e2e-beta-chrome: - test-e2e-beta-chrome:
requires: requires:
@ -37,7 +35,6 @@ workflows:
- test-e2e-beta-firefox: - test-e2e-beta-firefox:
requires: requires:
- prep-deps-npm - prep-deps-npm
- prep-deps-firefox
- prep-build - prep-build
- test-unit: - test-unit:
requires: requires:
@ -49,7 +46,6 @@ workflows:
- test-integration-mascara-firefox: - test-integration-mascara-firefox:
requires: requires:
- prep-deps-npm - prep-deps-npm
- prep-deps-firefox
- prep-scss - prep-scss
- test-integration-flat-chrome: - test-integration-flat-chrome:
requires: requires:
@ -58,7 +54,6 @@ workflows:
- test-integration-flat-firefox: - test-integration-flat-firefox:
requires: requires:
- prep-deps-npm - prep-deps-npm
- prep-deps-firefox
- prep-scss - prep-scss
- all-tests-pass: - all-tests-pass:
requires: requires:
@ -103,46 +98,34 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- v1.0-dependency-cache-{{ checksum "package-lock.json" }} - v1.0-dependency-cache-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1.0-dependency-cache-
- run: - run:
name: Install npm 6 + deps via npm name: Install npm 6 + deps via npm
command: | command: |
sudo npm install -g npm@6.1.0 && npm install --no-save sudo npm install -g npm@6 && npm install --no-save
- persist_to_workspace:
root: .
paths:
- node_modules
- save_cache: - save_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
paths: paths:
- node_modules - node_modules
prep-deps-firefox:
docker:
- image: circleci/node:8.11.3-browsers
steps:
- checkout
- restore_cache:
key: v1.0-dependency-cache-firefox-
- run:
name: Download Firefox If needed
command: ./.circleci/scripts/firefox-download.sh
- save_cache:
key: v1.0-dependency-cache-firefox-
paths:
- firefox
prep-build: prep-build:
docker: docker:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: build:dist name: build:dist
command: npm run dist command: npm run dist
- run: - run:
name: build:debug name: build:debug
command: find dist/ -type f -exec md5sum {} \; | sort -k 2 command: find dist/ -type f -exec md5sum {} \; | sort -k 2
- save_cache: - persist_to_workspace:
key: build-cache-{{ .Revision }} root: .
paths: paths:
- dist - dist
- builds - builds
@ -152,23 +135,23 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: build:dist name: build:dist
command: npm run doc command: npm run doc
- save_cache: - persist_to_workspace:
key: docs-cache-{{ .Revision }} root: .
paths: paths:
- docs/jsdoc - docs/jsdocs
prep-scss: prep-scss:
docker: docker:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Get Scss Cache key name: Get Scss Cache key
# this allows us to checksum against a whole directory # this allows us to checksum against a whole directory
@ -176,8 +159,8 @@ jobs:
- run: - run:
name: Build for integration tests name: Build for integration tests
command: npm run test:integration:build command: npm run test:integration:build
- save_cache: - persist_to_workspace:
key: scss-cache-{{ checksum "scss_checksum" }} root: .
paths: paths:
- ui/app/css/output - ui/app/css/output
@ -186,8 +169,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Test name: Test
command: npm run lint command: npm run lint
@ -197,8 +180,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: Test name: Test
command: npx nsp check command: npx nsp check
@ -208,10 +191,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:chrome name: test:e2e:chrome
command: npm run test:e2e:chrome command: npm run test:e2e:chrome
@ -224,15 +205,11 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache:
key: v1.0-dependency-cache-firefox-
- run: - run:
name: Install firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install.sh command: ./.circleci/scripts/firefox-install
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:firefox name: test:e2e:firefox
command: npm run test:e2e:firefox command: npm run test:e2e:firefox
@ -245,10 +222,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:chrome:beta name: test:e2e:chrome:beta
command: npm run test:e2e:chrome:beta command: npm run test:e2e:chrome:beta
@ -261,15 +236,11 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache:
key: v1.0-dependency-cache-firefox-
- run: - run:
name: Install firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install.sh command: ./.circleci/scripts/firefox-install
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: test:e2e:firefox:beta name: test:e2e:firefox:beta
command: npm run test:e2e:firefox:beta command: npm run test:e2e:firefox:beta
@ -282,15 +253,13 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- run: - run:
name: Test name: Test
command: npm run test:screens command: npm run test:screens
- save_cache: - persist_to_workspace:
key: job-screens-{{ .Revision }} root: .
paths: paths:
- test-artifacts - test-artifacts
@ -299,12 +268,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
key: job-screens-{{ .Revision }}
- store_artifacts: - store_artifacts:
path: dist/mascara path: dist/mascara
destination: builds/mascara destination: builds/mascara
@ -326,14 +291,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
key: docs-cache-{{ .Revision }}
- restore_cache:
key: job-screens-{{ .Revision }}
- run: - run:
name: sentry sourcemaps upload name: sentry sourcemaps upload
command: npm run sentry:publish command: npm run sentry:publish
@ -349,32 +308,22 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run: - run:
name: test:coverage name: test:coverage
command: npm run test:coverage command: npm run test:coverage
test-integration-flat-firefox: test-integration-flat-firefox:
environment:
browsers: '["Firefox"]'
docker: docker:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-firefox- at: .
- run: - run:
name: Install firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install.sh command: ./.circleci/scripts/firefox-install
- restore_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:flat name: test:integration:flat
command: npm run test:flat command: npm run test:flat
@ -386,38 +335,22 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:flat name: test:integration:flat
command: npm run test:flat command: npm run test:flat
test-integration-mascara-firefox: test-integration-mascara-firefox:
environment:
browsers: '["Firefox"]'
docker: docker:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-firefox- at: .
- run: - run:
name: Install firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install.sh command: ./.circleci/scripts/firefox-install
- restore_cache:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:mascara name: test:integration:mascara
command: npm run test:mascara command: npm run test:mascara
@ -429,14 +362,8 @@ jobs:
- image: circleci/node:8.11.3-browsers - image: circleci/node:8.11.3-browsers
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }} at: .
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
command: find ui/app/css -type f -exec md5sum {} \; | sort -k 2 > scss_checksum
- restore_cache:
key: scss-cache-{{ checksum "scss_checksum" }}
- run: - run:
name: test:integration:mascara name: test:integration:mascara
command: npm run test:mascara command: npm run test:mascara
@ -447,4 +374,4 @@ jobs:
steps: steps:
- run: - run:
name: All Tests Passed name: All Tests Passed
command: echo 'weew - everything passed!' command: echo 'weew - everything passed!'

View File

@ -1,13 +0,0 @@
#!/usr/bin/env bash
echo "Checking if firefox was already downloaded"
if [ -d "firefox" ]
then
echo "Firefox found. No need to download"
else
FIREFOX_VERSION="61.0.1"
FIREFOX_BINARY="firefox-$FIREFOX_VERSION.tar.bz2"
echo "Downloading firefox..."
wget "https://ftp.mozilla.org/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/$FIREFOX_BINARY" \
&& tar xjf "$FIREFOX_BINARY"
echo "firefox download complete"
fi

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
FIREFOX_VERSION='61.0.2'
FIREFOX_BINARY="firefox-${FIREFOX_VERSION}.tar.bz2"
FIREFOX_BINARY_URL="https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/${FIREFOX_BINARY}"
FIREFOX_PATH='/opt/firefox'
printf '%s\n' "Removing old Firefox installation"
sudo rm -r "${FIREFOX_PATH}"
printf '%s\n' "Downloading & installing Firefox ${FIREFOX_VERSION}"
wget --quiet --show-progress -O- "${FIREFOX_BINARY_URL}" | sudo tar xj -C /opt
printf '%s\n' "Firefox ${FIREFOX_VERSION} installed"
{
printf '%s\n' 'pref("general.config.filename", "firefox.cfg");'
printf '%s\n' 'pref("general.config.obscure_value", 0);'
} | sudo tee "${FIREFOX_PATH}/defaults/pref/autoconfig.js"
sudo cp .circleci/scripts/firefox.cfg "${FIREFOX_PATH}"
printf '%s\n' "Firefox ${FIREFOX_VERSION} configured"

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
echo "Installing firefox..."
sudo rm -r /opt/firefox
sudo mv firefox /opt/firefox61
sudo mv /usr/bin/firefox /usr/bin/firefox-old
sudo ln -s /opt/firefox61/firefox /usr/bin/firefox
echo "Firefox installed."

View File

@ -0,0 +1,13 @@
// IMPORTANT: Start your code on the 2nd line
lockPref("app.update.enabled", false);
lockPref("app.update.auto", false);
lockPref("app.update.mode", 0);
lockPref("app.update.service.enabled", false);
pref("browser.rights.3.shown", true);
pref("browser.startup.homepage_override.mstone","ignore");
lockPref("plugins.hide_infobar_for_outdated_plugin", true);
clearPref("plugins.update.url");