mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-10 17:20:11 -06:00
* server: remove obsolete desktop types * server: ensure project path generated by tests is ignored * driver: remove unused gulp deps * deploy: refactored to simplify uploading binary to S3 close #224 * refactored questions to allow asking only some information * ask for zip file * use option --zip to pass zip filename * install cloudflare-cli * working on making individual binary steps work * move buildDir and distDir to meta file * update references * refactor questions * Mac binary zipped and installed successfully * successful builds on both platforms, upload and install * refactor combined step deploy function * add building binary on linux to CircleCI * install root deps only * fine, make build binary depend on main build * server: fix app data path * name binary using SHA * server: unskip test concerning productName * build binary with serial mode * driver: improve visibility algorithm * server: add some logging around browser launching * docs: update cy.trigger position option - fixes #108 * desktop: fix invalid dom nesting * docs: Add FAQ question about 'how to test file download' * desktop: fix un-returned promise warning when logging in * rebuild node-sass for current platform automatically (#225) * uncomment two lines * desktop: use same dropdown as browsers for user menu * desktop: simplify build scripts, remove unused deps * readme: add docker cypress/base image badge * fix typo in readme * deploy: refactored to simplify uploading binary to S3 close #224 * refactored questions to allow asking only some information * ask for zip file * use option --zip to pass zip filename * install cloudflare-cli * working on making individual binary steps work * move buildDir and distDir to meta file * update references * refactor questions * Mac binary zipped and installed successfully * successful builds on both platforms, upload and install * refactor combined step deploy function * add building binary on linux to CircleCI * install root deps only * fine, make build binary depend on main build * name binary using SHA * build binary with serial mode * uncomment two lines * print build linux folder on CI
280 lines
9.1 KiB
YAML
280 lines
9.1 KiB
YAML
version: 2
|
|
|
|
defaults: &defaults
|
|
parallelism: 1
|
|
working_directory: ~/cypress-monorepo
|
|
docker:
|
|
# the Docker image with Cypress dependencies and Chrome browser
|
|
- image: cypress/internal:chrome58
|
|
environment:
|
|
## this enables colors + fixes failing unit tests
|
|
TERM: xterm
|
|
|
|
npm_config_loglevel: warn
|
|
# even when running as non-root user
|
|
# need to set unsafe perm to be able to do `npm postinstall`
|
|
npm_config_unsafe-perm: true
|
|
|
|
jobs:
|
|
## code checkout and NPM installs
|
|
build:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
## make sure the TERM is set to 'xterm' in node
|
|
## else colors (and tests) will fail
|
|
## See the following information
|
|
## * http://andykdocs.de/development/Docker/Fixing+the+Docker+TERM+variable+issue
|
|
## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables
|
|
- run:
|
|
name: Checking TERM is set
|
|
command: |
|
|
echo 'term env var is:' $TERM
|
|
node -e 'assert.equal(process.env.TERM, "xterm", "need TERM to be set for Docker to work")'
|
|
node -e 'console.log("TERM %s stdout.isTTY?", process.env.TERM, process.stdout.isTTY)'
|
|
|
|
# need to restore a separate cache for each package.json
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-cli-deps
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-root-deps
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-coffee
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-desktop-gui
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-driver
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-example
|
|
- restore_cache:
|
|
key: v7-{{ .Branch }}-deps-electron
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-extension
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-https-proxy
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-launcher
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-reporter
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-runner
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-server
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-socket
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-static
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-ts
|
|
- restore_cache:
|
|
key: v5-{{ .Branch }}-deps-docs
|
|
|
|
# only installs the root dependencies, without going into packages
|
|
# via postinstall script
|
|
- run: npm install --ignore-scripts
|
|
|
|
## symlink all of our sub packages in node_modules
|
|
- run: npm run link
|
|
|
|
## now install all of the sub packages node_modules
|
|
- run: npm run all install -- --serial
|
|
|
|
# save each node_modules folder per package
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-cli-deps-{{ checksum "cli/package.json" }}
|
|
paths:
|
|
- cli/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-root-deps-{{ checksum "package.json" }}
|
|
paths:
|
|
- node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-coffee-{{ checksum "packages/coffee/package.json" }}
|
|
paths:
|
|
- packages/coffee/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-desktop-gui-{{ checksum "packages/desktop-gui/package.json" }}
|
|
paths:
|
|
- packages/desktop-gui/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-driver-{{ checksum "packages/driver/package.json" }}
|
|
paths:
|
|
- packages/driver/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-example-{{ checksum "packages/example/package.json" }}
|
|
paths:
|
|
- packages/example/node_modules
|
|
- save_cache:
|
|
key: v7-{{ .Branch }}-deps-electron-{{ checksum "packages/electron/package.json" }}
|
|
paths:
|
|
- packages/electron/node_modules
|
|
- ~/.cache/electron
|
|
- ~/.electron
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-extension-{{ checksum "packages/extension/package.json" }}
|
|
paths:
|
|
- packages/extension/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-https-proxy-{{ checksum "packages/https-proxy/package.json" }}
|
|
paths:
|
|
- packages/https-proxy/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-launcher-{{ checksum "packages/launcher/package.json" }}
|
|
paths:
|
|
- packages/launcher/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-reporter-{{ checksum "packages/reporter/package.json" }}
|
|
paths:
|
|
- packages/reporter/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-runner-{{ checksum "packages/runner/package.json" }}
|
|
paths:
|
|
- packages/runner/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-server-{{ checksum "packages/server/package.json" }}
|
|
paths:
|
|
- packages/server/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-socket-{{ checksum "packages/socket/package.json" }}
|
|
paths:
|
|
- packages/socket/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-static-{{ checksum "packages/static/package.json" }}
|
|
paths:
|
|
- packages/static/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-ts-{{ checksum "packages/ts/package.json" }}
|
|
paths:
|
|
- packages/ts/node_modules
|
|
- save_cache:
|
|
key: v5-{{ .Branch }}-deps-docs-{{ checksum "docs/package.json" }}
|
|
paths:
|
|
- docs/node_modules
|
|
|
|
## now go build all of subpackages
|
|
- run: npm run build
|
|
|
|
## save entire folder as artifact for other jobs to continue
|
|
## hmm, do not see a good way to cache it, since all code
|
|
## might change
|
|
- save_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
paths:
|
|
- /home/person/cypress-monorepo
|
|
|
|
lint:
|
|
<<: *defaults
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: npm run lint
|
|
- run: npm run all lint
|
|
|
|
"unit-tests":
|
|
<<: *defaults
|
|
parallelism: 2
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: npm run all test -- --package cli
|
|
- run: npm run all test -- --package coffee
|
|
- run: npm run all test -- --package desktop-gui
|
|
- run: npm run all test -- --package electron
|
|
- run: npm run all test -- --package extension
|
|
- run: npm run all test -- --package https-proxy
|
|
- run: npm run all test -- --package launcher
|
|
- run: npm run all test -- --package reporter
|
|
- run: npm run all test -- --package runner
|
|
- run: npm run all test -- --package socket
|
|
- run: npm run all test -- --package static
|
|
|
|
"server-unit-tests":
|
|
<<: *defaults
|
|
parallelism: 2
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: npm run all test-unit -- --package server
|
|
|
|
"server-integration-tests":
|
|
<<: *defaults
|
|
parallelism: 2
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: npm run all test-integration -- --package server
|
|
|
|
"server-e2e-tests":
|
|
<<: *defaults
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: npm run all test-e2e -- --package server
|
|
|
|
"docs-tests":
|
|
<<: *defaults
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: cd docs && npm run test-e2e
|
|
|
|
"driver-unit-tests":
|
|
<<: *defaults
|
|
parallelism: 2
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: chrome --version
|
|
- run: xvfb-run -as "-screen 0 1280x720x16" npm run all test -- --package driver
|
|
|
|
"build-binary":
|
|
<<: *defaults
|
|
steps:
|
|
- restore_cache:
|
|
key: cypress-monorepo-{{ .Branch }}-{{ .Revision }}
|
|
- run: echo "Building version 0.0.0-$CIRCLE_BRANCH-${CIRCLE_SHA1:0:7}"
|
|
- run: npm run binary-build -- --platform linux --version "0.0.0-$CIRCLE_BRANCH-${CIRCLE_SHA1:0:7}"
|
|
- run: ls -la build/linux/Cypress
|
|
|
|
workflows:
|
|
version: 2
|
|
build_and_test:
|
|
jobs:
|
|
- build
|
|
- lint:
|
|
requires:
|
|
- build
|
|
- unit-tests:
|
|
requires:
|
|
- build
|
|
- server-unit-tests:
|
|
requires:
|
|
- build
|
|
- server-integration-tests:
|
|
requires:
|
|
- build
|
|
- server-e2e-tests:
|
|
requires:
|
|
- build
|
|
- docs-tests:
|
|
requires:
|
|
- build
|
|
- driver-unit-tests:
|
|
requires:
|
|
- build
|
|
- build-binary:
|
|
requires:
|
|
- build
|
|
|
|
#
|
|
# things to run in the 4th CI container
|
|
#
|
|
# - run:
|
|
# name: Example e2e tests
|
|
# command: |
|
|
# if [ $CIRCLE_NODE_INDEX == 3 ]; then
|
|
# # ./bin/cypress --project=./packages/example --path-to-cypress
|
|
# # xvfb-run -as "-screen 0 1280x720x16" npm start -- --project=./packages/example
|
|
# fi
|