Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Security Scan

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
# 10:17 on Fridays
- cron: '17 10 * * 5'
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
# 00:00 on Saturdays
- cron: '0 0 * * SAT'
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [10.x, 14.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: '2'

- name: Test on Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm install
- run: npm run lint
- run: npm run build
- run: npm run test

- name: Upload test coverage report to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![npm package](https://badge.fury.io/js/regex-to-strings.svg)](https://badge.fury.io/js/regex-to-strings)
![node version](https://img.shields.io/node/v/regex-to-strings.svg)
![npm type definitions](https://img.shields.io/npm/types/regex-to-strings)
[![Build Status](https://travis-ci.org/wimpyprogrammer/regex-to-strings.svg?branch=main)](https://travis-ci.org/wimpyprogrammer/regex-to-strings)
![Tests](https://github.com/wimpyprogrammer/regex-to-strings/workflows/Tests/badge.svg)
[![codecov](https://codecov.io/gh/wimpyprogrammer/regex-to-strings/branch/main/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/regex-to-strings)
[![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/regex-to-strings/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/regex-to-strings)

Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@
"node": ">=10"
},
"scripts": {
"build": "npm run clean && babel src -d lib --extensions '.js,.ts' --ignore '**/*.spec.js','**/*.spec.ts' && npm run build-types",
"build-demo": "npm run clean-demo && webpack --config demo/webpack.config.js",
"build-types": "tsc -p ./tsconfig.release-types.json",
"clean": "rimraf lib/*",
"clean-demo": "rimraf demo/lib/*",
"build": "run-s clean:* build:*",
"build:src": "babel src -d lib --extensions '.js,.ts' --ignore '**/*.spec.js','**/*.spec.ts'",
"build:demo": "webpack --config demo/webpack.config.js",
"build:types": "tsc -p ./tsconfig.release-types.json",
"clean:src": "rimraf lib/*",
"clean:demo": "rimraf demo/lib/*",
"format": "prettier --write '{src,demo/src}/**'",
"lint": "tsc -p ./tsconfig.release.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.release.json",
"lint-demo": "tsc -p ./demo/tsconfig.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./demo/tsconfig.json",
"lint-tests": "tsc -p ./tsconfig.test.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.test.json",
"lint": "run-s lint:*",
"lint:src": "tsc -p ./tsconfig.release.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.release.json",
"lint:demo": "tsc -p ./demo/tsconfig.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./demo/tsconfig.json",
"lint:tests": "tsc -p ./tsconfig.test.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.test.json",
"precommit": "pretty-quick --staged",
"prepublish": "npx publish-please guard",
"publish-please": "npx publish-please",
"publish-please-prereqs": "npm run lint && npm run test && npm run build",
"test": "jest --coverage",
"travisci": "npm run lint && npm run test && codecov && npx snyk test"
"test": "jest --coverage"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
Expand All @@ -66,6 +67,7 @@
"jest": "^26.4.2",
"jest-when": "^2.7.0",
"node-sass": "^4.12.0",
"npm-run-all": "^4.1.5",
"prettier": "1.18.2",
"pretty-quick": "1.7.0",
"rimraf": "^2.7.1",
Expand Down