Skip to content

Commit c0850f8

Browse files
Merge pull request #11 from wimpyprogrammer/feature/github-actions
Migrate from TravisCI to GitHub Actions
2 parents 43593ba + c8b30f1 commit c0850f8

File tree

5 files changed

+96
-20
lines changed

5 files changed

+96
-20
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
schedule:
9+
# 10:17 on Fridays
10+
- cron: '17 10 * * 5'
11+
workflow_dispatch:
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
language: ['javascript']
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v1
29+
with:
30+
languages: ${{ matrix.language }}
31+
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v1
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v1

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
schedule:
9+
# 00:00 on Saturdays
10+
- cron: '0 0 * * SAT'
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [10.x, 14.x]
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: '2'
28+
29+
- name: Test on Node ${{ matrix.node-version }}
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- run: npm install
35+
- run: npm run lint
36+
- run: npm run build
37+
- run: npm run test
38+
39+
- name: Upload test coverage report to Codecov
40+
uses: codecov/codecov-action@v1
41+
with:
42+
fail_ci_if_error: true
43+
44+
- name: Run Snyk to check for vulnerabilities
45+
uses: snyk/actions/node@master
46+
env:
47+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![npm package](https://badge.fury.io/js/regex-to-strings.svg)](https://badge.fury.io/js/regex-to-strings)
44
![node version](https://img.shields.io/node/v/regex-to-strings.svg)
55
![npm type definitions](https://img.shields.io/npm/types/regex-to-strings)
6-
[![Build Status](https://travis-ci.org/wimpyprogrammer/regex-to-strings.svg?branch=main)](https://travis-ci.org/wimpyprogrammer/regex-to-strings)
6+
![Tests](https://github.com/wimpyprogrammer/regex-to-strings/workflows/Tests/badge.svg)
77
[![codecov](https://codecov.io/gh/wimpyprogrammer/regex-to-strings/branch/main/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/regex-to-strings)
88
[![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/regex-to-strings/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/regex-to-strings)
99

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@
2525
"node": ">=10"
2626
},
2727
"scripts": {
28-
"build": "npm run clean && babel src -d lib --extensions '.js,.ts' --ignore '**/*.spec.js','**/*.spec.ts' && npm run build-types",
29-
"build-demo": "npm run clean-demo && webpack --config demo/webpack.config.js",
30-
"build-types": "tsc -p ./tsconfig.release-types.json",
31-
"clean": "rimraf lib/*",
32-
"clean-demo": "rimraf demo/lib/*",
28+
"build": "run-s clean:* build:*",
29+
"build:src": "babel src -d lib --extensions '.js,.ts' --ignore '**/*.spec.js','**/*.spec.ts'",
30+
"build:demo": "webpack --config demo/webpack.config.js",
31+
"build:types": "tsc -p ./tsconfig.release-types.json",
32+
"clean:src": "rimraf lib/*",
33+
"clean:demo": "rimraf demo/lib/*",
3334
"format": "prettier --write '{src,demo/src}/**'",
34-
"lint": "tsc -p ./tsconfig.release.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.release.json",
35-
"lint-demo": "tsc -p ./demo/tsconfig.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./demo/tsconfig.json",
36-
"lint-tests": "tsc -p ./tsconfig.test.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.test.json",
35+
"lint": "run-s lint:*",
36+
"lint:src": "tsc -p ./tsconfig.release.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.release.json",
37+
"lint:demo": "tsc -p ./demo/tsconfig.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./demo/tsconfig.json",
38+
"lint:tests": "tsc -p ./tsconfig.test.json && eslint . --ext .js,.ts --report-unused-disable-directives --parser-options=project:./tsconfig.test.json",
3739
"precommit": "pretty-quick --staged",
3840
"prepublish": "npx publish-please guard",
3941
"publish-please": "npx publish-please",
4042
"publish-please-prereqs": "npm run lint && npm run test && npm run build",
41-
"test": "jest --coverage",
42-
"travisci": "npm run lint && npm run test && codecov && npx snyk test"
43+
"test": "jest --coverage"
4344
},
4445
"devDependencies": {
4546
"@babel/cli": "^7.5.5",
@@ -66,6 +67,7 @@
6667
"jest": "^26.4.2",
6768
"jest-when": "^2.7.0",
6869
"node-sass": "^4.12.0",
70+
"npm-run-all": "^4.1.5",
6971
"prettier": "1.18.2",
7072
"pretty-quick": "1.7.0",
7173
"rimraf": "^2.7.1",

0 commit comments

Comments
 (0)