mirror of
https://github.com/Choices-js/Choices.git
synced 2024-04-27 19:42:51 +02:00
Add travis pipeline (#516)
* Update travis.yml * Simplify ci pipeline * Include css in bundle size check * Set npm username via env var * Specify branches * Add build scripts * Consistent ifs * Add linting stage to pipeline * Cache npm * Cache cypress & npm folders + install using ci method * Unignore package-lock
This commit is contained in:
parent
ba09fb00e6
commit
55b356ec69
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,10 +1,7 @@
|
||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.gitignore
|
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
tests/reports
|
tests/reports
|
||||||
|
|
50
.travis.yml
50
.travis.yml
|
@ -1,12 +1,44 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "8"
|
- 10
|
||||||
before_install:
|
cache:
|
||||||
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
|
directories:
|
||||||
- npm install -g npm@latest
|
- ~/.npm
|
||||||
|
- ~/.cache
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm ci
|
||||||
script:
|
jobs:
|
||||||
- npm run test
|
include:
|
||||||
after_script:
|
- stage: Judging bundle size
|
||||||
- npm run bundlesize
|
script: npm run bundlesize
|
||||||
|
|
||||||
|
- stage: Linting code
|
||||||
|
script: npm run lint
|
||||||
|
|
||||||
|
- stage: Running tests
|
||||||
|
script: npm run test
|
||||||
|
|
||||||
|
- stage: Building for publish
|
||||||
|
if: branch = master
|
||||||
|
script: npm run build && npm run bump-cache
|
||||||
|
|
||||||
|
- stage: Publishing to NPM
|
||||||
|
if: branch = master
|
||||||
|
script: echo "Publishing to NPM..."
|
||||||
|
deploy:
|
||||||
|
provider: npm
|
||||||
|
email: $NPM_EMAIL_ADDRESS
|
||||||
|
api_key: $NPM_API_KEY
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
|
||||||
|
- stage: Publishing to GitHub releases
|
||||||
|
if: branch = master
|
||||||
|
script: echo "Publishing to Github releases..."
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key: $GITHUB_OAUTH_TOKEN
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
tags: true
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"eslint.enable": true
|
||||||
|
}
|
15201
package-lock.json
generated
Normal file
15201
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "run-p js:watch css:watch",
|
"start": "run-p js:watch css:watch",
|
||||||
"build": "npm run js:build && npm run css:build",
|
"build": "npm run js:build && npm run css:build",
|
||||||
"lint": "eslint assets/**/*.js",
|
"lint": "eslint $(find src -name '*.js')",
|
||||||
"coverage": "nyc npm run test:unit",
|
"coverage": "nyc npm run test:unit",
|
||||||
"bundlesize": "bundlesize",
|
"bundlesize": "bundlesize",
|
||||||
"cypress:run": "$(npm bin)/cypress run",
|
"cypress:run": "$(npm bin)/cypress run",
|
||||||
|
@ -124,6 +124,10 @@
|
||||||
{
|
{
|
||||||
"path": "public/assets/scripts/choices.min.js",
|
"path": "public/assets/scripts/choices.min.js",
|
||||||
"maxSize": "25 kB"
|
"maxSize": "25 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "public/assets/styles/choices.min.css",
|
||||||
|
"maxSize": "2 kB"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,7 @@ describe('utils', () => {
|
||||||
describe('regexFilter', () => {
|
describe('regexFilter', () => {
|
||||||
it('tests given regex against given value', () => {
|
it('tests given regex against given value', () => {
|
||||||
// An email address regex
|
// An email address regex
|
||||||
|
// eslint-disable-next-line
|
||||||
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
|
|
||||||
expect(regexFilter('joe@bloggs.com', regex)).to.equal(true);
|
expect(regexFilter('joe@bloggs.com', regex)).to.equal(true);
|
||||||
|
|
Loading…
Reference in a new issue