Skip to content

Commit

Permalink
Workflow update :
Browse files Browse the repository at this point in the history
*  using env.ci file to call ci backend
*  split build and test
*  run cypress test
  • Loading branch information
jbgust committed Aug 14, 2019
1 parent c2fa320 commit c1a9baa
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
49 changes: 40 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
jobs:
build-and-test:
install:
working_directory: ~/meteor
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
key: npm-cache-v3-{{ checksum "package.json" }}
key: npm-cache-v4-{{ checksum "package.json" }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: npm-cache-v3-{{ checksum "package.json" }}
key: npm-cache-v4-{{ checksum "package.json" }}
paths:
- node_modules
jest:
working_directory: ~/meteor
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
key: npm-cache-v3-{{ checksum "package.json" }}
- run:
name: Run Tests
command: npm run test:unit
package:
cypress:
working_directory: ~/meteor
docker:
- image: circleci/node:8
- image: cypress/base:8
steps:
- checkout
- restore_cache:
Expand All @@ -29,8 +37,24 @@ jobs:
name: Install Dependencies
command: npm install
- run:
name: Build for production
command: npm run build -- --modern
name: Install wait-on
command: npm install wait-on
- run:
name: Run server and cypress tests
command: |
npm run ci & ./node_modules/.bin/wait-on -v --timeout 240000 http://localhost:8080
./node_modules/.bin/cypress run
package:
working_directory: ~/meteor
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
key: npm-cache-v3-{{ checksum "package.json" }}
- run:
name: Build for CI
command: npm run build -- --modern --mode ci
- run:
name: zip dist
command: zip -r meteor-dist.zip ./dist
Expand Down Expand Up @@ -66,10 +90,17 @@ workflows:
version: 2
build-test-and-approval-package:
jobs:
- build-and-test
- install
- jest:
requires:
- install
- cypress:
requires:
- install
- package:
requires:
- build-and-test
- jest
- cypress
- deploy:
requires:
- package
1 change: 1 addition & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_BASE_URL=https://ci.meteor.open-sky.fr/jsrm
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"ci": "vue-cli-service serve --mode ci",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"
Expand Down

0 comments on commit c1a9baa

Please sign in to comment.