diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..beadcbd17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: ci + +on: + push: + branches: + - develop + - 4.1-develop + pull_request: + branches: + - develop + - 4.1-develop + +jobs: + ci: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest ] + node: [ 14 ] + + steps: + - name: Checkout ๐Ÿ›Ž + uses: actions/checkout@master + + - name: Setup node env ๐Ÿ— + uses: actions/setup-node@v2.1.5 + with: + node-version: ${{ matrix.node }} + check-latest: true + cache: 'npm' + + - name: Install dependencies ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป + run: npm ci + + - name: Run linter ๐Ÿ‘€ + run: npm run lint + +# - name: Run tests ๐Ÿงช +# run: npm run test + + - name: Cypress run + uses: cypress-io/github-action@v1 + with: + start: npm run serve + wait-on: http://localhost:8080/ + config_file: cypress.json + spec: "tests/e2e/**/*" + + - name: Run build bundle ๐Ÿ“ฆ + run: npm run build-bundle diff --git a/package-lock.json b/package-lock.json index 324cb8999..f586fbe5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2324,20 +2324,20 @@ } }, "@vue/cli-plugin-e2e-cypress": { - "version": "4.5.13", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-e2e-cypress/-/cli-plugin-e2e-cypress-4.5.13.tgz", - "integrity": "sha512-7AyqCgDqgCj93QxkJYJG5YuXW07enHAYCdGZHPBHZKniIiq8VfvA6/ZT6TTU7DRr2/QxoIbXtbGnmNyDF/Urww==", + "version": "4.5.15", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-e2e-cypress/-/cli-plugin-e2e-cypress-4.5.15.tgz", + "integrity": "sha512-zVQe5tUlmYl20ZRMXoZ0x38gQPOFP3H5VGF0+v0Er2seJIMs507AfN08zuzs+DH864J33OKLJRVQruWFkkkOnQ==", "dev": true, "requires": { - "@vue/cli-shared-utils": "^4.5.13", + "@vue/cli-shared-utils": "^4.5.15", "cypress": "^3.8.3", "eslint-plugin-cypress": "^2.10.3" }, "dependencies": { "@vue/cli-shared-utils": { - "version": "4.5.13", - "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-4.5.13.tgz", - "integrity": "sha512-HpnOrkLg42RFUsQGMJv26oTG3J3FmKtO2WSRhKIIL+1ok3w9OjGCtA3nMMXN27f9eX14TqO64M36DaiSZ1fSiw==", + "version": "4.5.15", + "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-4.5.15.tgz", + "integrity": "sha512-SKaej9hHzzjKSOw1NlFmc6BSE0vcqUQMQiv1cxQ2DhVyy4QxZXBmzmiLBUBe+hYZZs1neXW7n//udeN9bCAY+Q==", "dev": true, "requires": { "@hapi/joi": "^15.0.1", @@ -7662,9 +7662,9 @@ } }, "eslint-plugin-cypress": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", - "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz", + "integrity": "sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==", "dev": true, "requires": { "globals": "^11.12.0" diff --git a/package.json b/package.json index 9144c821d..5dfd7fa94 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit", + "test:e2e": "vue-cli-service test:e2e", "lint": "vue-cli-service lint --no-fix", "build-bundle": "vue-cli-service build --target lib --name vue-form-builder ./src/components/index.js", "lint-fix": "vue-cli-service lint", @@ -12,15 +13,6 @@ "run-cypress": "TZ=UTC nyc cypress run", "test": "vue-cli-service test:unit" }, - "nyc": { - "include": [ - "src/**" - ], - "extension": [ - ".js", - ".vue" - ] - }, "main": "./dist/vue-form-builder.common.js", "files": [ "dist/*", @@ -47,7 +39,7 @@ "@processmaker/vue-form-elements": "0.28.2", "@processmaker/vue-multiselect": "^2.2.0", "@vue/cli-plugin-babel": "^3.6.0", - "@vue/cli-plugin-e2e-cypress": "^4.0.3", + "@vue/cli-plugin-e2e-cypress": "^4.5.15", "@vue/cli-plugin-eslint": "^3.6.0", "@vue/cli-plugin-unit-jest": "^4.3.0", "@vue/cli-service": "^3.6.0", @@ -99,5 +91,14 @@ "> 1%", "last 2 versions", "not ie <= 8" - ] + ], + "nyc": { + "include": [ + "src/**" + ], + "extension": [ + ".js", + ".vue" + ] + } } diff --git a/tests/e2e/support/commands.js b/tests/e2e/support/commands.js index 8c996a98b..99691124d 100644 --- a/tests/e2e/support/commands.js +++ b/tests/e2e/support/commands.js @@ -1,5 +1,5 @@ import '@4tw/cypress-drag-drop'; -import { set } from 'lodash'; +import set from 'lodash/set'; import 'cypress-wait-until'; Cypress.Commands.add('setPreviewDataInput', (input) => {