From 8d71cbed5f8a16c6194387fb4b3e7c504aca73c8 Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Fri, 20 Aug 2021 07:42:37 +0900 Subject: [PATCH 1/3] chore(ci): migrate from travis ci to github actions --- .github/workflows/linter.yml | 27 +++++++++++++++++ .github/workflows/tester.yml | 58 ++++++++++++++++++++++++++++++++++++ .travis.yml | 21 ------------- 3 files changed, 85 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/linter.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..3349333 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,27 @@ +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@v2 + 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 eslint + env: + CI: true \ No newline at end of file diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml new file mode 100644 index 0000000..fc89345 --- /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', '16.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@v2 + 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-cov + env: + CI: true + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 31b398a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js - -sudo: false - -cache: - apt: true - directories: - - node_modules - -node_js: - - "10" - - "12" - - "14" - -script: - - npm run eslint - - npm run test-cov - -after_script: - - npm install coveralls - - nyc report --reporter=text-lcov | coveralls From f9a8f72cee43ddb542fb9bd41b702cef83a69a10 Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Fri, 20 Aug 2021 07:45:25 +0900 Subject: [PATCH 2/3] chore: update ci badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a08085..0cff079 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # hexo-log -[![Build Status](https://travis-ci.org/hexojs/hexo-log.svg?branch=master)](https://travis-ci.org/hexojs/hexo-log) +[![Build Status](https://github.com/hexojs/hexo-log/workflows/Tester/badge.svg?branch=master)](https://github.com/hexojs/hexo-log/actions?query=workflow%3ATester) [![NPM version](https://badge.fury.io/js/hexo-log.svg)](https://www.npmjs.com/package/hexo-log) [![Coverage Status](https://coveralls.io/repos/hexojs/hexo-log/badge.svg?branch=master)](https://coveralls.io/r/hexojs/hexo-log?branch=master) From cf3f8d6e84a73b7098bac6bbaf2b6b5549c1001c Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Fri, 20 Aug 2021 07:46:12 +0900 Subject: [PATCH 3/3] chore: drop node 10.x --- .github/workflows/tester.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml index fc89345..a84aa28 100644 --- a/.github/workflows/tester.yml +++ b/.github/workflows/tester.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: ['10.x', '12.x', '14.x', '16.x'] + node-version: ['12.x', '14.x', '16.x'] fail-fast: false steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index ec6ff59..6f39ea4 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,6 @@ "sinon": "^10.0.1" }, "engines": { - "node": ">=10.13.0" + "node": ">=12.4.0" } }