From a5678832a1a81ffa5fd68faaeded9c786ec49506 Mon Sep 17 00:00:00 2001 From: hustcc Date: Wed, 27 Mar 2024 20:12:19 +0800 Subject: [PATCH] test: change travis to github action (#29) --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ .npmignore | 1 - .travis.yml | 10 ---------- README.md | 2 +- package.json | 4 +--- 5 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..710a33c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: build + +on: [push, pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.event_name}}-${{github.ref}} + cancel-in-progress: true + +jobs: + test-and-build: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 13 + + - name: Install Dependencies + run: npm install + + - name: Run build & test + run: | + npm run build + + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2.2.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmignore b/.npmignore index 7937633..e825736 100644 --- a/.npmignore +++ b/.npmignore @@ -6,4 +6,3 @@ package-lock.json __tests__ src .babelrc -.travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a37dfe..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - "8" - - "9" - - "10" - - "11" - - "12" - - "13" -after_success: - - npm run coveralls diff --git a/README.md b/README.md index f17fd0e..e0b137b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > Mock `Date` when run unit test cases with jest. Make tests of `Date` easier. -[![Build Status](https://travis-ci.org/hustcc/jest-date-mock.svg?branch=master)](https://travis-ci.org/hustcc/jest-date-mock) +[![Build Status](https://github.com/hustcc/jest-date-mock/workflows/build/badge.svg)](https://github.com/hustcc/jest-date-mock/actions) [![Coverage Status](https://coveralls.io/repos/github/hustcc/jest-date-mock/badge.svg?branch=master)](https://coveralls.io/github/hustcc/jest-date-mock) [![npm](https://img.shields.io/npm/v/jest-date-mock.svg)](https://www.npmjs.com/package/jest-date-mock) [![npm](https://img.shields.io/npm/dm/jest-date-mock.svg)](https://www.npmjs.com/package/jest-date-mock) diff --git a/package.json b/package.json index 36438ee..5b36abc 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "typings": "lib/index.d.ts", "scripts": { "test": "jest --no-cache", - "build": "babel src --out-dir lib --copy-files && npm run test", - "coveralls": "cat ./coverage/lcov.info | coveralls" + "build": "babel src --out-dir lib --copy-files && npm run test" }, "repository": { "type": "git", @@ -33,7 +32,6 @@ "@babel/preset-env": "^7.7.7", "babel-jest": "^24.9.0", "babel-plugin-version": "^0.2.2", - "coveralls": "^3.0.0", "jest": "^24.9.0" }, "jest": {