zepio/.circleci/config.yml

106 lines
3.6 KiB
YAML

version: 2
jobs:
test:
docker:
- image: electronuserland/builder:wine-chrome
steps:
- checkout
- run: apt-get -y update
- run: apt install -y software-properties-common
- run: add-apt-repository ppa:jonathonf/ffmpeg-4
- run: apt-get -y update
- run: apt-get -y install libusb-1.0-0-dev graphicsmagick libudev-dev
- run: apt-get -y install tmux xvfb libxtst6 libxss1 libgtk2.0-0 libnss3 libasound2 libgconf-2-4 ffmpeg frei0r-plugins
- run: yarn install
- run:
name: Run Unit Tests
command: yarn test:unit
- run:
name: Run Webpack
command: yarn dev
background: true
- run:
name: Run Mock RPC API
command: yarn e2e:serve
background: true
- run: yarn wait-on http://localhost:8080 && yarn wait-on http://localhost:18232
- run:
command: Xvfb :44 -auth /tmp/xvfb.auth -ac -screen 0 1024x768x24 -listen tcp
background: true
- run:
command: ffmpeg -y -f x11grab -video_size 1024x768 -i :44 -codec:v libx264 -r 12 /tmp/e2e-record.mp4
background: true
- run: DISPLAY=:44 yarn e2e:run
- run: |
kill -s SIGINT $(pgrep ffmpeg)
sleep 10
kill -s SIGTERM $(pgrep Xvfb)
- save_cache:
key: zec-dependencies-cache-{{ checksum "yarn.lock" }}
paths:
- /usr/local/share/.cache/yarn/v2
- ./node_modules
- store_artifacts:
path: /tmp/e2e-record.mp4
destination: e2e-record.mp4
build_linux:
docker:
- image: electronuserland/builder:wine-chrome
steps:
- checkout
- restore_cache:
key: zec-dependencies-cache-{{ checksum "yarn.lock" }}
- run: yarn electron:dist -l
- store_artifacts:
path: ./dist/zec-react-wallet_0.3.0_amd64.deb
destination: zec-react-wallet_0.3.0_amd64.deb
- run:
name: Upload to Slack
command: |
export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g')
curl -F file=@dist/zec-react-wallet_0.3.0_amd64.deb -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload
build_windows:
docker:
- image: electronuserland/builder:wine-chrome
steps:
- checkout
- restore_cache:
key: zec-dependencies-cache-{{ checksum "yarn.lock" }}
- run:
name: Download PFX certificate
command: echo ${WIN_CERTIFICATE_PFX} | base64 --decode > win-certificate.pfx
- run:
name: Build Windows Installer
command: yarn electron:dist -w
- store_artifacts:
path: ./dist/ZEC Wallet Setup 0.3.0.exe
destination: ZEC Wallet Setup 0.3.0.exe
- run:
name: Upload to Slack
command: |
export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g')
curl -F file="@dist/ZEC Wallet Setup 0.3.0.exe" -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload
workflows:
version: 2
build_test:
jobs:
- test
- build_linux:
requires:
- test
filters:
branches:
only:
- master
- build_windows:
requires:
- test
filters:
branches:
only:
- master