From 57db21d2ad9ec33add3d677573adfba4e023c396 Mon Sep 17 00:00:00 2001 From: MDLeom <43627182+curbengh@users.noreply.github.com> Date: Sat, 5 Sep 2020 12:43:05 +0000 Subject: [PATCH] ci: replace travis with actions --- .github/workflows/linter.yml | 24 +++++++++++++++ .github/workflows/snyk.yml | 18 +++++++++++ .github/workflows/tester.yml | 58 ++++++++++++++++++++++++++++++++++++ .travis.yml | 25 ---------------- 4 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/linter.yml create mode 100644 .github/workflows/snyk.yml create mode 100644 .github/workflows/tester.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..c7a8365 --- /dev/null +++ b/.github/workflows/linter.yml @@ -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 diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml new file mode 100644 index 0000000..8429e2b --- /dev/null +++ b/.github/workflows/snyk.yml @@ -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 diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml new file mode 100644 index 0000000..ba1a997 --- /dev/null +++ b/.github/workflows/tester.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f702bc4..0000000 --- a/.travis.yml +++ /dev/null @@ -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