ci: replace travis with actions

This commit is contained in:
MDLeom 2020-09-05 12:43:05 +00:00
parent 51cc9b1d8d
commit 57db21d2ad
No known key found for this signature in database
GPG Key ID: 06C236E63CBC68AA
4 changed files with 100 additions and 25 deletions

24
.github/workflows/linter.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Linter
on: [push, pull_request]
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: |
${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Lint
run: npm run lint

18
.github/workflows/snyk.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Snyk
on:
schedule:
# Every day
- cron: '*/0 0 * * *'
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor

58
.github/workflows/tester.yml vendored Normal file
View File

@ -0,0 +1,58 @@
name: Tester
on: [push, pull_request]
jobs:
tester:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['10.x', '12.x', '14.x']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Test
run: npm run test
env:
CI: true
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: ['12.x']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Coverage
run: npm run test
env:
CI: true
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true

View File

@ -1,25 +0,0 @@
dist: bionic
language: node_js
node_js:
- "10"
- "12"
- "14"
cache:
npm: true
script:
- npm run lint
- npm run test
after_script:
- if ([[ $TRAVIS_EVENT_TYPE == "push" ]] || [[ $TRAVIS_EVENT_TYPE == "cron" ]]) && [[ $TRAVIS_BRANCH == "master" ]] && [[ $TRAVIS_NODE_VERSION == "12" ]]; then
npm install snyk;
snyk auth $SNYK_TOKEN;
snyk test;
snyk protect;
snyk monitor;
fi
- npm install codecov
- codecov