Skip to content

Commit

Permalink
chore: setup github actions (#1606)
Browse files Browse the repository at this point in the history
* chore: prevent git from ignoring src/index.js file

* chore: remove unused exclusion from nyc config

* chore: replace travis-ci with github actions

* chore: fix issue with github workflow config

* chore: fix condition for coverage generation and sending

* chore: treat node version as int

* docs: replace travis with github actions badge

* chore: add npm publish github action

* chore: remove auto-generated files

* chore: improve github actions styles

* chore: use correct repo url to prevent unecessary redirect

* chore: lint package.json file

* chore: add new line at end of file

* chore: set a fixed ubuntu version instead of relying on latest
  • Loading branch information
tux-tn authored Feb 26, 2021
1 parent 9b03daf commit 941abe1
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 5,442 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14, 12, 10, 8, 6]
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
- if: matrix.node-version == 14
name: Generate coverage file
run: npm run test:ci > coverage.lcov
- if: matrix.node-version == 14
name: Send coverage info to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.lcov
24 changes: 24 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: NPM Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: Setup Node.js 14
uses: actions/setup-node@v2-beta
with:
node-version: 14
check-latest: true
registry-url: https://registry.npmjs.org/
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
- name: Publish Package to NPM Registry
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ package-lock.json
yarn.lock
/es
/lib
/index.js
validator.js
validator.min.js
index.js
4 changes: 0 additions & 4 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
],
"include": [
"src/**/*.js"
],
"exclude": [
"validator.js",
"lib/**/*.js"
]
}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

610 changes: 305 additions & 305 deletions CHANGELOG.md

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# validator.js

[![NPM version][npm-image]][npm-url]
[![Build Status](https://travis-ci.org/validatorjs/validator.js.svg?branch=master)](https://travis-ci.org/validatorjs/validator.js)
[![codecov](https://codecov.io/gh/validatorjs/validator.js/branch/master/graph/badge.svg)](https://codecov.io/gh/validatorjs/validator.js)
[![CI][ci-image]][ci-url]
[![Coverage][codecov-image]][codecov-url]
[![Downloads][downloads-image]][npm-url]
[![Backers on Open Collective](https://opencollective.com/validatorjs/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/validatorjs/sponsors/badge.svg)](#sponsors)
Expand Down Expand Up @@ -183,7 +183,7 @@ Sanitizer | Description

### XSS Sanitization

XSS sanitization was removed from the library in [2d5d6999](https://github.com/chriso/validator.js/commit/2d5d6999541add350fb396ef02dc42ca3215049e).
XSS sanitization was removed from the library in [2d5d6999](https://github.com/validatorjs/validator.js/commit/2d5d6999541add350fb396ef02dc42ca3215049e).

For an alternative, have a look at Yahoo's [xss-filters library](https://github.com/yahoo/xss-filters) or at [DOMPurify](https://github.com/cure53/DOMPurify).

Expand Down Expand Up @@ -253,8 +253,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[npm-url]: https://npmjs.org/package/validator
[npm-image]: http://img.shields.io/npm/v/validator.svg

[travis-url]: https://travis-ci.org/chriso/validator.js
[travis-image]: http://img.shields.io/travis/chriso/validator.js.svg
[codecov-url]: https://codecov.io/gh/validatorjs/validator.js
[codecov-image]: https://codecov.io/gh/validatorjs/validator.js/branch/master/graph/badge.svg

[ci-url]: https://github.com/validatorjs/validator.js/actions?query=workflow%3ACI
[ci-image]: https://github.com/validatorjs/validator.js/workflows/CI/badge.svg?branch=master

[amd]: http://requirejs.org/docs/whyamd.html
[bower]: http://bower.io/
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "validator-js",
"main": "validator.js",
"homepage": "https://github.com/chriso/validator.js",
"homepage": "https://github.com/validatorjs/validator.js",
"authors": [
"Chris O'Hara <cohara87+gh@gmail.com>"
],
Expand Down
Loading

0 comments on commit 941abe1

Please sign in to comment.