From 60b33f1c211c64e875b12ed9328c56bc2fe5f56c Mon Sep 17 00:00:00 2001 From: MDLeom <43627182+curbengh@users.noreply.github.com> Date: Fri, 24 Jul 2020 12:14:42 +0100 Subject: [PATCH] ci: replace travis with github actions --- .github/workflows/tester.yml | 58 ++++++++++++++++++++++++++++++++++++ .travis.yml | 16 ---------- package.json | 2 +- 3 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/tester.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml new file mode 100644 index 0000000..2059a34 --- /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: ['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@v1 + 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@v1 + 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-cov + env: + CI: true + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0749502..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: node_js - -cache: - npm: true - -node_js: - - "12" - - "14" - -script: - - npm run eslint - - npm run test-cov - -after_script: - - npm install coveralls - - nyc report --reporter=text-lcov | coveralls diff --git a/package.json b/package.json index 129a20d..52dcf5c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "scripts": { "test": "mocha test/index.js", - "test-cov": "nyc npm run test", + "test-cov": "nyc --reporter=lcovonly npm run test", "eslint": "eslint ." }, "repository": "hexojs/hexo-migrator-wordpress",