diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f3e9fb4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Tests +on: [push, pull_request] + +jobs: + test: + name: Node ${{ matrix.node }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: [6, 8.16.1, 10, 12] + os: [ubuntu-latest, windows-latest] + + steps: + - name: Clone repository + uses: actions/checkout@v1 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - run: node --version + - run: npm --version + + - name: Install npm dependencies + run: npm install # switch to `npm ci` when Node.js 6.x is dropped + env: + CI: true + + - name: Run tests with coverage + run: npm run test:cov + if: startsWith(matrix.os, 'ubuntu') + + - name: Run tests without coverage + run: npm test + if: startsWith(matrix.os, 'windows') + + - name: Run Coveralls + run: npm run coveralls + if: matrix.node == 10 && startsWith(matrix.os, 'ubuntu') && github.repository == 'errorception/staticify' && github.event_name == 'push' + env: + COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" + COVERALLS_GIT_BRANCH: "${{ github.ref }}" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4105cfc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -git: - depth: 5 - -language: node_js - -node_js: - - "6" - - "8" - - "10" - - "12" - -os: - - linux - - windows - -script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then npm run test:cov; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm run test; fi - -after_success: - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_NODE_VERSION" = "10" ]]; then npm run coveralls; fi - -cache: npm - -notifications: - email: false diff --git a/README.md b/README.md index f000897..fc8d27f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # staticify [![NPM version](https://img.shields.io/npm/v/staticify.svg)](https://www.npmjs.com/package/staticify) -[![Build Status](https://img.shields.io/travis/errorception/staticify/master.svg?label=Build%20Status)](https://travis-ci.org/errorception/staticify) +[![Build Status](https://github.com/errorception/staticify/workflows/Tests/badge.svg)](https://github.com/errorception/staticify/actions) [![Coverage Status](https://img.shields.io/coveralls/github/errorception/staticify/master.svg)](https://coveralls.io/github/errorception/staticify?branch=master) [![dependencies Status](https://img.shields.io/david/errorception/staticify.svg)](https://david-dm.org/errorception/staticify) [![devDependencies Status](https://img.shields.io/david/dev/errorception/staticify.svg)](https://david-dm.org/errorception/staticify?type=dev)