2018-08-24 14:35:42 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-09-06 14:37:27 +00:00
|
|
|
unit-test:
|
|
|
|
docker:
|
|
|
|
- image: cypress/base:8
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
|
|
|
- v1-deps-{{ .Branch }}
|
|
|
|
- v1-deps
|
|
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- save_cache:
|
|
|
|
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
|
|
|
paths:
|
|
|
|
- ~/.cache
|
|
|
|
- run: |
|
|
|
|
yarn run flow-typed install
|
|
|
|
git config --global core.quotepath false
|
|
|
|
yarn test
|
|
|
|
|
|
|
|
end-to-end-test:
|
2018-08-24 14:35:42 +00:00
|
|
|
docker:
|
2018-09-05 15:45:45 +00:00
|
|
|
- image: cypress/base:8
|
|
|
|
environment:
|
|
|
|
## this enables colors in the output
|
|
|
|
TERM: xterm
|
|
|
|
CYPRESS_baseUrl: http://localhost:5000
|
2018-08-24 14:35:42 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-08-29 16:34:07 +00:00
|
|
|
keys:
|
2018-09-05 15:45:45 +00:00
|
|
|
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
|
|
|
- v1-deps-{{ .Branch }}
|
|
|
|
- v1-deps
|
2018-09-06 14:37:27 +00:00
|
|
|
- run: yarn install --frozen-lockfile
|
2018-08-24 14:35:42 +00:00
|
|
|
- save_cache:
|
2018-09-05 15:45:45 +00:00
|
|
|
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
2018-08-24 14:35:42 +00:00
|
|
|
paths:
|
2018-09-05 15:45:45 +00:00
|
|
|
- ~/.cache
|
2018-09-06 14:37:27 +00:00
|
|
|
- run: |
|
|
|
|
yarn run compile
|
|
|
|
yarn run serve:embauche &
|
|
|
|
yarn run cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --spec 'cypress/integration/**/!(external-integrations.js)'
|
|
|
|
|
2018-09-06 16:36:14 +00:00
|
|
|
test-production:
|
2018-09-06 14:37:27 +00:00
|
|
|
docker:
|
|
|
|
- image: cypress/base:8
|
|
|
|
environment:
|
|
|
|
## this enables colors in the output
|
|
|
|
TERM: xterm
|
|
|
|
CYPRESS_baseUrl: http://embauche.beta.gouv.fr
|
|
|
|
steps:
|
|
|
|
- run: npm install --save-dev cypress
|
|
|
|
# We wait an arbitrary 4 min for the deploy (TODO: use netlify hook for triggering a this job)
|
|
|
|
- run: sleep 4 * 60 * 60
|
|
|
|
- run: yarn run cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
test:
|
|
|
|
jobs:
|
|
|
|
- unit-test
|
|
|
|
- end-to-end-test
|
2018-09-06 16:36:14 +00:00
|
|
|
- test-production:
|
2018-09-06 14:37:27 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
|
|
|
|
experimental:
|
|
|
|
notify:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|