Run frontend-tests with dist in ci (#605)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/605 Co-authored-by: konrad <konrad@kola-entertainments.de> Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
2429be7c72
commit
b547029379
1 changed files with 28 additions and 5 deletions
33
.drone.yml
33
.drone.yml
|
@ -67,7 +67,7 @@ steps:
|
||||||
depends_on:
|
depends_on:
|
||||||
- dependencies
|
- dependencies
|
||||||
|
|
||||||
- name: build
|
- name: lint
|
||||||
image: node:16
|
image: node:16
|
||||||
pull: true
|
pull: true
|
||||||
environment:
|
environment:
|
||||||
|
@ -75,7 +75,29 @@ steps:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||||
commands:
|
commands:
|
||||||
- yarn run lint
|
- yarn run lint
|
||||||
- yarn run build
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
# Building in dev mode to avoid the service worker for testing
|
||||||
|
- name: build-dev
|
||||||
|
image: node:16
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
YARN_CACHE_FOLDER: .cache/yarn/
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||||
|
commands:
|
||||||
|
- yarn build --mode dev
|
||||||
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
- name: build-prod
|
||||||
|
image: node:16
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
YARN_CACHE_FOLDER: .cache/yarn/
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||||
|
commands:
|
||||||
|
- yarn build --dest dist-prod
|
||||||
depends_on:
|
depends_on:
|
||||||
- dependencies
|
- dependencies
|
||||||
|
|
||||||
|
@ -88,7 +110,7 @@ steps:
|
||||||
- dependencies
|
- dependencies
|
||||||
|
|
||||||
- name: test-frontend
|
- name: test-frontend
|
||||||
image: cypress/browsers:node12.18.3-chrome87-ff82
|
image: cypress/browsers:node14.17.0-chrome91-ff89
|
||||||
pull: true
|
pull: true
|
||||||
environment:
|
environment:
|
||||||
CYPRESS_API_URL: http://api:3456/api/v1
|
CYPRESS_API_URL: http://api:3456/api/v1
|
||||||
|
@ -97,11 +119,12 @@ steps:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||||
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
||||||
commands:
|
commands:
|
||||||
- sed -i 's/localhost/api/g' public/index.html
|
- sed -i 's/localhost/api/g' dist/index.html
|
||||||
- yarn serve & npx wait-on http://localhost:8080
|
- yarn serve:dist & npx wait-on http://localhost:8080
|
||||||
- yarn test:frontend --browser chrome
|
- yarn test:frontend --browser chrome
|
||||||
depends_on:
|
depends_on:
|
||||||
- dependencies
|
- dependencies
|
||||||
|
- build-dev
|
||||||
|
|
||||||
- name: upload-test-results
|
- name: upload-test-results
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
|
|
Loading…
Reference in a new issue