mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-19 14:06:33 +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
|
||||
npm-debug.log
|
||||
.DS_Store
|
||||
.gitignore
|
||||
.idea
|
||||
.vscode
|
||||
package-lock.json
|
||||
|
||||
# Test
|
||||
tests/reports
|
||||
|
|
50
.travis.yml
50
.travis.yml
|
@ -1,12 +1,44 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
before_install:
|
||||
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
|
||||
- npm install -g npm@latest
|
||||
- 10
|
||||
cache:
|
||||
directories:
|
||||
- ~/.npm
|
||||
- ~/.cache
|
||||
install:
|
||||
- npm install
|
||||
script:
|
||||
- npm run test
|
||||
after_script:
|
||||
- npm run bundlesize
|
||||
- npm ci
|
||||
jobs:
|
||||
include:
|
||||
- stage: Judging bundle size
|
||||
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": {
|
||||
"start": "run-p js:watch css:watch",
|
||||
"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",
|
||||
"bundlesize": "bundlesize",
|
||||
"cypress:run": "$(npm bin)/cypress run",
|
||||
|
@ -124,6 +124,10 @@
|
|||
{
|
||||
"path": "public/assets/scripts/choices.min.js",
|
||||
"maxSize": "25 kB"
|
||||
},
|
||||
{
|
||||
"path": "public/assets/styles/choices.min.css",
|
||||
"maxSize": "2 kB"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -251,6 +251,7 @@ describe('utils', () => {
|
|||
describe('regexFilter', () => {
|
||||
it('tests given regex against given value', () => {
|
||||
// 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,}))$/;
|
||||
|
||||
expect(regexFilter('joe@bloggs.com', regex)).to.equal(true);
|
||||
|
|
Loading…
Reference in a new issue