diff --git a/.circleci/config.yml b/.circleci/config.yml index c40fa3c2a..21cf3fb2b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,489 +1,625 @@ -version: 2 +version: 2.1 aliases: - - &cache_version '2' - - &step_prepare_cache_buster - run: - name: Prepare Cache Buster - command: echo ${CACHE_VERSION} > /tmp/cache_buster - - &step_setup_nvm - run: - name: Setup NVM + - &cache_version '2' + - &step_prepare_cache_buster + run: + name: Prepare Cache Buster + command: echo ${CACHE_VERSION} > /tmp/cache_buster + - &step_setup_nvm + run: + name: Setup NVM + command: | + export NODE_VERSION=$(cat .nvmrc) + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash -s -- --no-use + echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV + echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV + - &step_restore_cache_mac + restore_cache: + name: Restore Yarn Package Cache + keys: + - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}- + - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}}-dev + - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}}- + - &step_save_cache_mac + save_cache: + name: Save Yarn Package Cache + key: yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: + - node_modules/ + - &step_restore_cache + restore_cache: + name: Restore Yarn Package Cache + keys: + - yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}- + - yarn-packages-{{ checksum "/tmp/cache_buster" }}-dev + - yarn-packages-{{ checksum "/tmp/cache_buster" }}- + - &step_save_cache + save_cache: + name: Save Yarn Package Cache + key: yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: + - node_modules/ + - &step_yarn_upgrade + run: + name: Upgrade Yarn + command: npm install -g yarn@latest +orbs: + win: circleci/windows@2.2.0 +jobs: + 'unit-test': + docker: &DOCKERIMAGE + - image: circleci/node:10.13.0-stretch-browsers + environment: + CACHE_VERSION: *cache_version + JEST_JUNIT_OUTPUT_DIR: dist/junit + JEST_JUNIT_UNIQUE_OUTPUT_NAME: 'true' + JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' + parallelism: 2 + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Install OS Dependecies command: | - export NODE_VERSION=$(cat .nvmrc) - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash -s -- --no-use - echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV - echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV - - &step_restore_cache_mac - restore_cache: - name: Restore Yarn Package Cache - keys: - - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} - - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}- - - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}}-dev - - yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}}- - - &step_save_cache_mac - save_cache: - name: Save Yarn Package Cache - key: yarn-packages-mac-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + sudo apt-get update + sudo apt-get install build-essential + sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev + - run: + name: Install Node Packages + command: NOYARNPOSTINSTALL=1 yarn + - run: + name: Unit Tests + command: | + TESTFILES=$(circleci tests glob "src/**/*.{spec,test}.js" | circleci tests split --split-by=timings) + echo "This job runs the following tests:" + circleci tests glob "src/**/*.{spec,test}.js" | circleci tests split --split-by=timings| xargs -n 1 echo + yarn test:unit:ci:split $TESTFILES --coverageDirectory="dist/coverage/${CIRCLE_NODE_INDEX}/" + - store_test_results: + path: dist/junit + - persist_to_workspace: + root: . paths: - - node_modules/ - - &step_restore_cache - restore_cache: - name: Restore Yarn Package Cache - keys: - - yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} - - yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}- - - yarn-packages-{{ checksum "/tmp/cache_buster" }}-dev - - yarn-packages-{{ checksum "/tmp/cache_buster" }}- - - &step_save_cache - save_cache: - name: Save Yarn Package Cache - key: yarn-packages-{{ checksum "/tmp/cache_buster" }}-{{ .Branch }}-{{ checksum "yarn.lock" }} + - dist + - *step_save_cache + 'coveralls': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - run: + name: Install OS Icov + command: | + sudo apt-get update -y + sudo apt-get install -y lcov + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Get coverage from attach_workspace + command: | + mkdir -p dist + cp -r /tmp/linux/dist/coverage dist/coverage + - run: + name: Merge coverage reports + command: find dist/coverage -name lcov.info -exec echo -a {} \; | xargs lcov -o dist/coverage/lcov.info + - run: + name: Coveralls + command: yarn coveralls + - store_artifacts: + path: dist + + 'build-storybook': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + NODE_OPTIONS: --max_old_space_size=4096 + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Build Storybook + command: yarn build-storybook + - persist_to_workspace: + root: . paths: - - node_modules/ - - &step_yarn_upgrade - run: - name: Upgrade Yarn - command: npm install -g yarn@latest + - dist + 'publish-storybook': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Get storybook from attach_workspace + command: | + mkdir -p dist + cp -r /tmp/linux/dist/storybook dist/storybook + - run: + name: Story book + command: yarn deploy-storybook-ci -jobs: - 'unit-test': - docker: &DOCKERIMAGE - - image: circleci/node:10.13.0-stretch-browsers - environment: - CACHE_VERSION: *cache_version - JEST_JUNIT_OUTPUT_DIR: dist/junit - JEST_JUNIT_UNIQUE_OUTPUT_NAME: 'true' - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - run: - name: Install OS Dependecies - command: | - sudo apt-get update - sudo apt-get install build-essential - sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev - - run: - name: Install Node Packages - command: yarn install-all - - run: - name: Unit Tests - command: yarn test:unit:ci - - run: - name: Coveralls - command: yarn coveralls - - store_test_results: - path: dist/junit - - store_artifacts: - path: dist - - *step_save_cache - 'build-storybook': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - NODE_OPTIONS: --max_old_space_size=4096 - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - run: - name: Build Storybook - command: yarn build-storybook - - persist_to_workspace: - root: . - paths: - - dist - 'publish-storybook': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - run: - name: Get storybook from attach_workspace - command: | - mkdir -p dist - cp -r /tmp/linux/dist/storybook dist/storybook - - run: - name: Story book - command: yarn deploy-storybook-ci + 'build-mac': + macos: + xcode: '11.7.0' + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/mac + - *step_prepare_cache_buster + - *step_restore_cache_mac + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: Add Read Access to yarn config + command: | + sudo mkdir -p ~/.config + sudo chown -R $USER:$GROUP ~/.config - 'build-mac': - macos: - xcode: '11.7.0' - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/mac - - *step_prepare_cache_buster - - *step_restore_cache_mac - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: Add Read Access to yarn config - command: | - sudo mkdir -p ~/.config - sudo chown -R $USER:$GROUP ~/.config + - run: + name: Install Node Packages + command: yarn install-all + no_output_timeout: 30m - - run: - name: Install Node Packages - command: yarn install-all - no_output_timeout: 30m + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Build App + command: yarn dist --publish=never + no_output_timeout: 80m + - persist_to_workspace: + root: . + paths: + - dist + - store_artifacts: + path: dist/{latest,SelfKey Identity,selfkey-identity}* + - *step_save_cache_mac + 'build-windows': + executor: win/default + environment: + OSENV: windows + NO_PROXY: 127.0.0.1,localhost + DEBUG: electron-builder + steps: + - checkout + - restore_cache: + name: Restore Yarn Package Cache + keys: + - yarn-packages-win-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-packages-win-{{ .Branch }}- + - yarn-packages-win-dev- + - yarn-packages-win- + - run: tzutil /s "UTC" + - run: git config --global core.autocrlf input + - run: + name: 'Install OpenSSL' + command: | + $wc = New-Object System.Net.WebClient + $wc.DownloadFile("https://storage.googleapis.com/win-open-ssl/Win64OpenSSL-1_0_2r.exe", "Win64OpenSSL-1_0_2r.exe") + Start-Process 'Win64OpenSSL-1_0_2r.exe' -ArgumentList '/silent /verysilent /sp- /suppressmsgboxes' -Wait + refreshenv + - run: + name: Install Node + command: | + nvm use 10.13.0 + npm i -g yarn + - run: + name: Install Build Tools + command: | + npm install --global --production windows-build-tools@4.0.0 + npm config set msvs_version 2015 --global + npm config set python %USERPROFILE%\.windows-build-tools\python27 + - run: + name: Install Deps + command: | + yarn install + yarn build-dll + yarn install-app-deps + - run: echo {"dsn":"%SENTRY_DSN%"} > src\assets\data\sentry.json + - run: yarn dist --publish=never + - store_artifacts: + path: dist/*.exe + - save_cache: + name: Save Yarn Package Cache + key: yarn-packages-win-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: + - node_modules\ + 'stage-windows': + executor: win/default + environment: + OSENV: windows + NO_PROXY: 127.0.0.1,localhost + steps: + - checkout + - run: Write-Host 'TODO implement' + 'publish-windows': + executor: win/default + environment: + OSENV: windows + NO_PROXY: 127.0.0.1,localhost + steps: + - checkout + - run: Write-Host 'TODO implement' + 'build-linux': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Install OS Dependecies + command: | + sudo apt-get update + sudo apt-get install libudev-dev + sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev + sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross g++-arm-linux-gnueabihf + - run: + name: Install Node Packages + command: yarn install-all + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Build App + command: yarn dist --publish=never + - persist_to_workspace: + root: . + paths: + - dist + - store_artifacts: + path: dist/{latest,SelfKey Identity,selfkey-identity}* + - *step_save_cache + 'e2e-mac': + macos: + xcode: '11.7.0' + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/mac + - *step_prepare_cache_buster + - *step_restore_cache_mac + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: Add Read Access to yarn config + command: | + sudo mkdir -p ~/.config + sudo chown -R $USER:$GROUP ~/.config + - run: + name: E2E Tests + command: OSENV=circle-mac yarn test:e2e + 'e2e-linux': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: E2E Tests + command: OSENV=circle-linux yarn test:e2e - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Build App - command: yarn dist --publish=never - no_output_timeout: 80m - - persist_to_workspace: - root: . - paths: - - dist - - store_artifacts: - path: dist/{latest,SelfKey Identity,selfkey-identity}* - - *step_save_cache_mac - 'build-linux': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - run: - name: Install OS Dependecies - command: | - sudo apt-get update - sudo apt-get install libudev-dev - sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev - sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross g++-arm-linux-gnueabihf - - run: - name: Install Node Packages - command: yarn install-all - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Build App - command: yarn dist --publish=never - - persist_to_workspace: - root: . - paths: - - dist - - store_artifacts: - path: dist/{latest,SelfKey Identity,selfkey-identity}* - - *step_save_cache - 'e2e-mac': - macos: - xcode: '11.7.0' - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/mac - - *step_prepare_cache_buster - - *step_restore_cache_mac - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: Add Read Access to yarn config - command: | - sudo mkdir -p ~/.config - sudo chown -R $USER:$GROUP ~/.config - - run: - name: E2E Tests - command: OSENV=circle-mac yarn test:e2e + 'stage-mac': + docker: &GGLOUDIMAGE + - image: google/cloud-sdk:latest + steps: + - checkout + - attach_workspace: + at: /tmp/mac + - run: + name: Deploy mac to staging + command: bash deploy.sh "$(git log --format=%B -n 1 $CIRCLE_SHA1)" + environment: + OSENV: mac - 'e2e-linux': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: E2E Tests - command: OSENV=circle-linux yarn test:e2e + 'stage-linux': + docker: &GGLOUDIMAGE + - image: google/cloud-sdk:latest + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - run: + name: Deploy linux to staging + command: bash deploy.sh "$(git log --format=%B -n 1 $CIRCLE_SHA1)" + environment: + OSENV: linux - 'stage-mac': - docker: &GGLOUDIMAGE - - image: google/cloud-sdk:latest - steps: - - checkout - - attach_workspace: - at: /tmp/mac - - run: - name: Deploy mac to staging - command: bash deploy.sh "$(git log --format=%B -n 1 $CIRCLE_SHA1)" - environment: - OSENV: mac + 'publish-mac': + macos: + xcode: '11.7.0' + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/mac + - *step_prepare_cache_buster + - *step_restore_cache_mac + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Publish App to Github + command: yarn publish-build + no_output_timeout: 1h - 'stage-linux': - docker: &GGLOUDIMAGE - - image: google/cloud-sdk:latest - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - run: - name: Deploy linux to staging - command: bash deploy.sh "$(git log --format=%B -n 1 $CIRCLE_SHA1)" - environment: - OSENV: linux + 'publish-linux': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: Install OS Dependecies + command: | + sudo apt-get update + sudo apt-get install build-essential + sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev + - run: + name: Install Node Packages + command: yarn install-all + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Publish App to Github + command: yarn publish-build - 'publish-mac': - macos: - xcode: '11.7.0' - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/mac - - *step_prepare_cache_buster - - *step_restore_cache_mac - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Publish App to Github - command: yarn publish-build - no_output_timeout: 1h + 'mac-prepare-auto-update-test': + macos: + xcode: '11.7.0' + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/mac + - *step_prepare_cache_buster + - *step_restore_cache_mac + - *step_setup_nvm + - *step_yarn_upgrade + - run: + name: Add Read Access to yarn config + command: | + sudo mkdir -p ~/.config + sudo chown -R $USER:$GROUP ~/.config - 'publish-linux': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: Install OS Dependecies - command: | - sudo apt-get update - sudo apt-get install build-essential - sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev - - run: - name: Install Node Packages - command: yarn install-all - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Publish App to Github - command: yarn publish-build + - run: + name: Install Node Packages + command: yarn install-all + no_output_timeout: 30m - 'mac-prepare-auto-update-test': - macos: - xcode: '11.7.0' - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/mac - - *step_prepare_cache_buster - - *step_restore_cache_mac - - *step_setup_nvm - - *step_yarn_upgrade - - run: - name: Add Read Access to yarn config - command: | - sudo mkdir -p ~/.config - sudo chown -R $USER:$GROUP ~/.config + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Bump auto update version + command: yarn auto-update-version + - run: + name: Build App + command: NOTARIZE=1 yarn dist --publish=never + no_output_timeout: 80m + - persist_to_workspace: + root: . + paths: + - dist + - store_artifacts: + path: dist/{latest,SelfKey Identity,selfkey-identity}* + - *step_save_cache_mac + 'linux-prepare-auto-update-test': + docker: *DOCKERIMAGE + environment: + CACHE_VERSION: *cache_version + steps: + - checkout + - attach_workspace: + at: /tmp/linux + - *step_prepare_cache_buster + - *step_restore_cache + - run: + name: Install OS Dependecies + command: | + sudo apt-get update + sudo apt-get install libudev-dev + sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev + sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross g++-arm-linux-gnueabihf + - run: + name: Install Node Packages + command: yarn install-all + - run: + name: Set Sentry + command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json + - run: + name: Bump auto update version + command: yarn auto-update-version + - run: + name: Build App + command: yarn dist --publish=never + - persist_to_workspace: + root: . + paths: + - dist + - store_artifacts: + path: dist/{latest,SelfKey Identity,selfkey-identity}* + - *step_save_cache - - run: - name: Install Node Packages - command: yarn install-all - no_output_timeout: 30m +workflows: + version: 2 + auto-update-test: + jobs: + - 'mac-prepare-auto-update-test': + filters: + branches: + only: + - auto-update-test + - 'stage-mac': + requires: + - mac-prepare-auto-update-test + filters: + branches: + only: + - auto-update-test + - 'linux-prepare-auto-update-test': + filters: + branches: + only: + - auto-update-test + - 'stage-linux': + requires: + - linux-prepare-auto-update-test + filters: + branches: + only: + - auto-update-test - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Bump auto update version - command: yarn auto-update-version - - run: - name: Build App - command: NOTARIZE=1 yarn dist --publish=never - no_output_timeout: 80m - - persist_to_workspace: - root: . - paths: - - dist - - store_artifacts: - path: dist/{latest,SelfKey Identity,selfkey-identity}* - - *step_save_cache_mac - 'linux-prepare-auto-update-test': - docker: *DOCKERIMAGE - environment: - CACHE_VERSION: *cache_version - steps: - - checkout - - attach_workspace: - at: /tmp/linux - - *step_prepare_cache_buster - - *step_restore_cache - - run: - name: Install OS Dependecies - command: | - sudo apt-get update - sudo apt-get install libudev-dev - sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libudev-dev - sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross g++-arm-linux-gnueabihf - - run: - name: Install Node Packages - command: yarn install-all - - run: - name: Set Sentry - command: echo {\"dsn\":\"${SENTRY_DSN}\"} > src/main/assets/data/sentry.json - - run: - name: Bump auto update version - command: yarn auto-update-version - - run: - name: Build App - command: yarn dist --publish=never - - persist_to_workspace: - root: . - paths: - - dist - - store_artifacts: - path: dist/{latest,SelfKey Identity,selfkey-identity}* - - *step_save_cache + main: + jobs: + - 'unit-test': + filters: + branches: + ignore: + - auto-update-test + - coveralls: + requires: + - unit-test + filters: + branches: + ignore: + - auto-update-test + - 'build-linux': + requires: + - unit-test + filters: + branches: + ignore: + - auto-update-test -workflows: - version: 2 - auto-update-test: - jobs: - - 'mac-prepare-auto-update-test': - filters: - branches: - only: - - auto-update-test - - 'stage-mac': - requires: - - mac-prepare-auto-update-test - filters: - branches: - only: - - auto-update-test - - 'linux-prepare-auto-update-test': - filters: - branches: - only: - - auto-update-test - - 'stage-linux': - requires: - - linux-prepare-auto-update-test - filters: - branches: - only: - - auto-update-test + # - 'e2e-linux': + # requires: + # - build-linux + - 'stage-linux': + requires: + # - e2e-linux + - build-linux + # - build-linux-arm + filters: + branches: + only: + - dev + - nightly + - release + - /staging.*/ + - 'build-windows': + requires: + - unit-test + filters: + branches: + ignore: + - auto-update-test + - 'stage-windows': + requires: + # - e2e-linux + - build-windows + # - build-linux-arm + filters: + branches: + only: + - dev + - nightly + - release + - /staging.*/ - main: - jobs: - - 'unit-test': - filters: - branches: - ignore: - - auto-update-test - - 'build-linux': - requires: - - unit-test - filters: - branches: - ignore: - - auto-update-test - # - 'e2e-linux': - # requires: - # - build-linux - - 'stage-linux': - requires: - # - e2e-linux - - build-linux - # - build-linux-arm - filters: - branches: - only: - - dev - - nightly - - release - - /staging.*/ - - 'build-mac': - requires: - - unit-test - filters: - branches: - ignore: - - auto-update-test - # - 'e2e-mac': - # requires: - # - build-mac - - 'stage-mac': - requires: - # - e2e-mac - - build-mac - filters: - branches: - only: - - dev - - nightly - - release - - /staging.*/ - - 'build-storybook': - requires: - - unit-test - filters: - branches: - only: - - dev - - 'publish-storybook': - requires: - - build-storybook - filters: - branches: - only: - - dev - - 'publish-mac': - requires: - - build-mac - filters: - branches: - only: - - master - - 'publish-linux': - requires: - # - e2e-linux - - build-linux - filters: - branches: - only: - - master + - 'build-mac': + requires: + - unit-test + filters: + branches: + ignore: + - auto-update-test + # - 'e2e-mac': + # requires: + # - build-mac + - 'stage-mac': + requires: + # - e2e-mac + - build-mac + filters: + branches: + only: + - dev + - nightly + - release + - /staging.*/ + - 'build-storybook': + requires: + - unit-test + filters: + branches: + only: + - dev + - 'publish-storybook': + requires: + - build-storybook + filters: + branches: + only: + - dev + - 'publish-mac': + requires: + - build-mac + filters: + branches: + only: + - master + - 'publish-linux': + requires: + # - e2e-linux + - build-linux + filters: + branches: + only: + - master + - 'publish-windows': + requires: + # - e2e-linux + - build-windows + filters: + branches: + only: + - master diff --git a/.prettierrc.json b/.prettierrc.json index 93362fa72..57084b99c 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -7,5 +7,14 @@ "trailingComma": "none", "bracketSpacing": true, "arrowParens": "avoid", - "proseWrap": "never" + "proseWrap": "never", + "overrides": [ + { + "files": "*.{yml,yaml}", + "options": { + "tabWidth": 2, + "useTabs": false + } + } + ] } diff --git a/jest.config.js b/jest.config.js index 27907ebe2..497e16b4a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,7 +13,7 @@ module.exports = { testEnvironment: 'jsdom', testURL: 'http://localhost/', collectCoverageFrom: ['src/{main,common}/**/*.js'], - coverageReporters: ['json', 'lcov', 'text'], + coverageReporters: ['lcov'], coveragePathIgnorePatterns: ['src/main/(seed|assets|migrations)'], coverageDirectory: 'dist/coverage', coverageThreshold: {}, diff --git a/package.json b/package.json index e24f02d1a..2411b3866 100644 --- a/package.json +++ b/package.json @@ -48,13 +48,14 @@ "test:unit": "jest -i --forceExit", "test:unit:coverage": "yarn test:unit --testPathPattern='src' --coverage", "test:unit:ci": "yarn test:unit:coverage --ci --reporters=default --reporters=jest-junit", - "test:e2e": "jest -i --config='jest.e2e.config.js'", + "test:unit:ci:split": "jest -i --forceExit --ci --coverage --reporters=default --reporters=jest-junit", + "test:e2e": "jest -i --config='jest.e2e.config.js' --ci --reporters=default --reporters=jest-junit", "publish-build": "yarn compile && electron-builder -p always", "check-deps-precommit": "npm-check -i eslint -i redux -s || true", "check-deps": "npm-check -i common", "coveralls": "cat dist/coverage/lcov.info | coveralls", "snyk-protect": "NODE_OPTIONS=--max-old-space-size=8192 snyk protect", - "postinstall": "yarn build-dll", + "postinstall": "test -n \"$NOYARNPOSTINSTALL\" || yarn build-dll", "build-dll": "rm -rf node_modules/.cache && electron-webpack dll --env.production=${BUILD_DLL_PRODUCTION:-true}", "build-dev-dll": "BUILD_DLL_PRODUCTION=false yarn build-dll", "storybook": "start-storybook -p 6007",