From 6434d7d4e74fb40d8ce780799c47419297586971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E9=95=BF?= Date: Wed, 21 Feb 2024 08:35:02 +0000 Subject: [PATCH 1/3] ci: Migrate from Travis CI to GitHub Actions - ci: Remove Travis CI configuration - ci: Add GitHub Actions workflow testing under node majors 4~20 - chore: Remove `test-all` package script --- .github/workflows/node-test.js.yml | 43 ++++++++++++++++++++++++++++++ .travis.yml | 8 ------ package.json | 3 +-- 3 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/node-test.js.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/node-test.js.yml b/.github/workflows/node-test.js.yml new file mode 100644 index 0000000..79505f0 --- /dev/null +++ b/.github/workflows/node-test.js.yml @@ -0,0 +1,43 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: + - 0.10.x + - 0.12.x + - 4.x + - 6.x + - 8.x + - 10.x + - 12.x + - 14.x + - 16.x + - 18.x + - 20.x + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + # TODO: Enable cache when checking in package lockfile to git + # cache: 'npm' + - run: npm install + - run: npm run test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ac34208..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -sudo: false -language: node_js -node_js: - - 0.10 - - 0.12 - - io.js -before_install: - - npm install --global npm diff --git a/package.json b/package.json index 0e18be8..3beaf82 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "test-0.8": "nave use 0.8 npm run test-main", "test-0.10": "nave use 0.10 npm run test-main", "test-0.12": "nave use 0.12 npm run test-main", - "test-all": "npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run test-0.12", - "test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi" + "test": "npm run test-main" }, "repository": { "type": "git", From 23778f1339a100402cc4b05e6c145804e09eeb88 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 22 Feb 2024 04:38:35 +0000 Subject: [PATCH 2/3] ci: disable node versions failing tests --- .github/workflows/node-test.js.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node-test.js.yml b/.github/workflows/node-test.js.yml index 79505f0..af61341 100644 --- a/.github/workflows/node-test.js.yml +++ b/.github/workflows/node-test.js.yml @@ -24,12 +24,12 @@ jobs: - 4.x - 6.x - 8.x - - 10.x - - 12.x - - 14.x - - 16.x - - 18.x - - 20.x + # - 10.x + # - 12.x + # - 14.x + # - 16.x + # - 18.x + # - 20.x steps: - uses: actions/checkout@v4 From 41787c5932d86609cce77a9f3921de96938cc238 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Fri, 23 Feb 2024 02:09:44 +0000 Subject: [PATCH 3/3] docs: GitHub Actions test status shield --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8315753..540c3d7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# inline-source-map [![build status](https://secure.travis-ci.org/thlorenz/inline-source-map.png)](http://travis-ci.org/thlorenz/inline-source-map) +# inline-source-map [![build status](https://github.com/thlorenz/inline-source-map/actions/workflows/node-test.js.yml/badge.svg)](https://github.com/thlorenz/inline-source-map/actions/workflows/node-test.js.yml/badge.svg) Adds source mappings and base64 encodes them, so they can be inlined in your generated file. @@ -6,7 +6,7 @@ Adds source mappings and base64 encodes them, so they can be inlined in your gen var generator = require('inline-source-map'); // default charset 'utf-8' is configurable -var gen = generator({ charset: 'utf-8' }) +var gen = generator({ charset: 'utf-8' }) .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }); @@ -25,7 +25,7 @@ inline mapping url: //# sourceMappingURL=data:application/json;charset=utf-8;bas ``` /** - * Adds the given mappings to the generator and offsets them if offset is given + * Adds the given mappings to the generator and offsets them if offset is given * * @name addMappings * @function @@ -56,7 +56,7 @@ inline mapping url: //# sourceMappingURL=data:application/json;charset=utf-8;bas ``` /** * Adds source content for the given source file. - * + * * @name addSourceContent * @function * @param sourceFile {String} The source file for which a mapping is included @@ -84,6 +84,6 @@ If source contents were added, this will be included in the encoded mappings. /** * @name inlineMappingUrl * @function - * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. + * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. */ ```