Files
connect/.circleci/config.yml
2020-11-02 13:16:51 -08:00

90 lines
3.5 KiB
YAML

version: 2
jobs:
test_web:
working_directory: ~/blockstack-app
docker:
- image: mcr.microsoft.com/playwright:bionic
environment:
NODE_ENV: development
steps:
- checkout
- run:
name: Install yarn
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# - run:
# name: Update apt-get
# working_directory: /
# command: |
# sudo apt-get update -y
# - run:
# name: Install Chrome headless dependencies
# working_directory: /
# command: |
# sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
# libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
# libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
# libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
# ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
# - run:
# name: Install webkit dependencies
# working_directory: /
# command: |
# sudo apt-get install -yq --no-install-recommends \
# libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 \
# libgdk-pixbuf2.0-0 libegl1 libnotify4 libxslt1.1 libevent-2.1-6 libgles2 libvpx5 libxcomposite1 \
# libatk1.0-0 libatk-bridge2.0-0 libepoxy0 libgtk-3-0 libharfbuzz-icu0
- run:
name: Combine package.json files to single file
command: npx lerna list -p -a | awk -F packages '{printf "\"packages%s/package.json\" ", $2}' | xargs cat > combined-yarn-lock.txt
- restore_cache:
# https://circleci.com/docs/2.0/caching/
keys:
- yarn-packages-{{ checksum "package.json" }}-{{ checksum "combined-yarn-lock.txt" }}
- yarn-packages
- run:
name: Install Dependencies
command: $HOME/.yarn/bin/yarn --frozen-lockfile
- run:
name: Install package dependencies
command: $HOME/.yarn/bin/yarn lerna bootstrap
- save_cache:
key: yarn-packages-{{ checksum "package.json" }}-{{ checksum "combined-yarn-lock.txt" }}
paths:
- ./.cache/yarn
- run:
name: Build Connect UI
command: $HOME/.yarn/bin/yarn lerna run build --scope @stacks/connect-ui
- run:
name: test server
command: $HOME/.yarn/bin/yarn lerna run dev --scope @stacks/app
background: true
- run:
name: Run test app
command: $HOME/.yarn/bin/yarn lerna run dev --scope test-app --stream
background: true
- run:
name: Setup screenshots folder
command: mkdir packages/app/tests/screenshots
- run:
name: test
command: $HOME/.yarn/bin/yarn lerna run test:ci --scope @stacks/app --stream
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/junit/
# https://circleci.com/docs/2.0/artifacts/
- store_artifacts:
path: packages/app/tests/screenshots
- store_test_results:
path: ./reports/junit/
- store_artifacts:
path: ./reports/junit
workflows:
version: 2
test:
jobs:
- test_web