2019-02-07 16:40:34 +00:00
version : 2.1
commands :
install :
2018-09-06 14:37:27 +00:00
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
2019-02-07 16:40:34 +00:00
jobs :
unit-test :
docker :
- image : node
steps :
- install
2018-09-06 14:37:27 +00:00
- run : |
2019-02-07 16:40:34 +00:00
yarn run flow-typed install
2018-09-06 14:37:27 +00:00
git config --global core.quotepath false
yarn test
end-to-end-test :
2019-02-07 16:40:34 +00:00
parameters :
site :
type : enum
enum : [ 'embauche' , 'mon-entreprise' , 'mycompanyinfrance' ]
cypress_folder :
type : enum
enum : [ 'embauche' , 'mon-entreprise' ]
default : mon-entreprise
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 :
2019-02-07 16:40:34 +00:00
- install
2018-09-06 14:37:27 +00:00
- run : |
yarn run compile
2019-02-07 16:40:34 +00:00
yarn run serve:<< parameters.site >> &
yarn run cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --spec 'cypress/integration/<< parameters.cypress_folder >>/**/*.js'
2018-09-06 14:37:27 +00:00
2019-02-07 16:40:34 +00:00
production-end-to-end-test :
parameters :
site :
type : string
default : ''
cypress_folder :
type : enum
enum : [ 'embauche' , 'mon-entreprise' , 'external' ]
default : mon-entreprise
2018-09-06 16:38:37 +00:00
docker :
- image : cypress/base:8
environment :
## this enables colors in the output
TERM : xterm
2019-02-07 16:40:34 +00:00
CYPRESS_baseUrl : << parameters.site >>
2018-09-06 16:38:37 +00:00
steps :
2018-09-06 17:37:20 +00:00
- checkout
2018-09-06 16:38:37 +00:00
- run : npm install --save-dev cypress
2019-02-07 16:40:34 +00:00
- run : sleep 300
2018-09-06 17:35:42 +00:00
- run : |
2019-02-07 16:40:34 +00:00
if ./node_modules/.bin/cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --spec 'cypress/integration/<< parameters.cypress_folder >>/**/*.js';
2018-09-06 17:35:42 +00:00
then
echo "SUCCESS \o/"
else
2018-09-06 17:42:27 +00:00
curl -H 'Content-Type : application/json' --request POST -d '{"success": false}' https://hooks.zapier.com/hooks/catch/3746650/qsp818/;
2018-09-06 17:35:42 +00:00
exit 1;
fi
2018-09-06 14:37:27 +00:00
workflows :
version : 2
test :
jobs :
- unit-test
2019-02-07 16:40:34 +00:00
- end-to-end-test :
site : embauche
cypress_folder : embauche
# - end-to-end-test:
# site: mon-entreprise
# cypress_folder: mon-entreprise
# - end-to-end-test:
# site: mycompanyinfrance
# cypress_folder: mon-entreprise
- production-end-to-end-test :
site : 'https://embauche.beta.gouv.fr'
cypress_folder : 'embauche'
filters :
branches :
only : master
# - production-end-to-end-test:
# site: 'https://mon-entreprise.fr'
# cypress_folder: 'mon-entreprise'
# filters:
# branches:
# only: master
# - production-end-to-end-test:
# site: 'https://mycompanyinfrance.fr'
# cypress_folder: 'mon-entreprise'
# filters:
# branches:
# only: master
# - production-end-to-end-test:
# site: 'https://demo.mon-entreprise.fr'
# cypress_folder: 'embauche'
# filters:
# branches:
# only: demo
- production-end-to-end-test :
cypress_folder : 'external'
2018-09-06 14:37:27 +00:00
filters :
branches :
only : master