diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..197cf4c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +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: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 14.x] + + steps: + - 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 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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f43eb2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - 'node' - - '10' -script: - - npm run travisci -cache: - directories: - - node_modules diff --git a/README.md b/README.md index d81b959..49e1abe 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![npm package](https://badge.fury.io/js/strings-to-regex.svg)](https://badge.fury.io/js/strings-to-regex) ![node version](https://img.shields.io/node/v/strings-to-regex.svg) ![npm type definitions](https://img.shields.io/npm/types/strings-to-regex) -[![Build Status](https://travis-ci.org/wimpyprogrammer/strings-to-regex.svg?branch=main)](https://travis-ci.org/wimpyprogrammer/strings-to-regex) +![Tests status](https://github.com/wimpyprogrammer/strings-to-regex/workflows/Tests/badge.svg) [![codecov](https://codecov.io/gh/wimpyprogrammer/strings-to-regex/branch/main/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/strings-to-regex) [![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/strings-to-regex/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/strings-to-regex) diff --git a/package.json b/package.json index 022d532..dd3a5e1 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,7 @@ "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" }, "jest": { "collectCoverageFrom": [