diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..d853b70 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,30 @@ +name: test +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + strategy: + matrix: + platform: [ubuntu-latest, windows-latest] + node-version: [4.x, 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x] + python-version: [2.6, 2.7, 3.6, 3.7, 3.8, 3.9, 3.10] + # @TODO 2.6 + fail-fast: false + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: python -V && node --version + - run: npm install -d + # - run: npm run build --if-present + - run: npm test diff --git a/.travis.yml b/.travis.yml index c3faf26..8077ce6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,60 @@ language: python +dist: bionic os: - "linux" -env: - - NODE_VERSION="11" - - NODE_VERSION="10" - - NODE_VERSION="9" - - NODE_VERSION="8" - - NODE_VERSION="7.5" - - NODE_VERSION="6.1" - - NODE_VERSION="5.11" - - NODE_VERSION="4.4" -python: - - "3.7-dev" - - "3.6" - - "3.5" - - "3.4" - - "3.3" - - "3.2" - - "2.7" - - "2.6" +jobs: + include: + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="14" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="13" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="12" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="11" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="10" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="9" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="8" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="7.5" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="6.1" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="5.11" + - language: generic + env: PYTHON_VERSION="2.6" NODE_VERSION="4.4" + - os: windows + language: node_js + node_js: 12 + env: >- + PATH=/c/Python27:/c/Python27/Scripts:$PATH + NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe + before_install: + - env + - echo "WINDOWS!!!" + - choco install python2 + - node --version + - python -V before_install: - - rm -rf ~/.nvm - - git clone https://github.com/creationix/nvm.git ~/.nvm - - source ~/.nvm/nvm.sh + - env - nvm install $NODE_VERSION + - | + if [ "${PYTHON_VERSION}" == "2.6" ]; then + sudo apt-get update + sudo apt-get install -yq software-properties-common + sudo add-apt-repository ppa:deadsnakes/ppa -y + sudo apt-get update -q + sudo apt-get install -yq python2.6 + sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python2.6 0 + export PATH="/usr/local/bin:$PATH" + fi + - which python + - which node + - python -V + - node --version install: - npm install -d before_script: diff --git a/README.md b/README.md index fe17e57..24017dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# python-bridge [![Build Status](https://secure.travis-ci.org/Submersible/node-python-bridge.png?branch=master)](http://travis-ci.org/Submersible/node-python-bridge) [![Build Status](https://ci.appveyor.com/api/projects/status/8h64yyve684nn900/branch/master?svg=true)](https://ci.appveyor.com/project/munro/node-python-bridge/branch/master) +# python-bridge [![Build Status](https://github.com/Submersible/node-python-bridge/workflows/test/badge.svg?branch=master)](https://github.com/Submersible/node-python-bridge/actions?query=workflow%3Atest+branch%3Amaster) [![Build Status](https://secure.travis-ci.org/Submersible/node-python-bridge.png?branch=master)](http://travis-ci.org/Submersible/node-python-bridge) Most robust and simple Python bridge. [Features](#features), and [comparisons](#comparisons) to other Python bridges below, supports Windows. diff --git a/README.ts.md b/README.ts.md index 676bd76..ed4a45d 100644 --- a/README.ts.md +++ b/README.ts.md @@ -1,4 +1,4 @@ -# python-bridge [![Build Status](https://secure.travis-ci.org/Submersible/node-python-bridge.png?branch=master)](http://travis-ci.org/Submersible/node-python-bridge) [![Build Status](https://ci.appveyor.com/api/projects/status/8h64yyve684nn900/branch/master?svg=true)](https://ci.appveyor.com/project/munro/node-python-bridge/branch/master) +# python-bridge [![Build Status](https://github.com/Submersible/node-python-bridge/workflows/test/badge.svg?branch=master)](https://github.com/Submersible/node-python-bridge/actions?query=workflow%3Atest+branch%3Amaster) [![Build Status](https://secure.travis-ci.org/Submersible/node-python-bridge.png?branch=master)](http://travis-ci.org/Submersible/node-python-bridge) Most robust and simple Python bridge. [Features](#features), and [comparisons](#comparisons) to other Python bridges below, supports Windows. diff --git a/package.json b/package.json index e4c2124..ce7b0ce 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "types": "index.d.ts", "scripts": { "lint": "npm run lint:ts", - "lint:ts": "tslint --project tsconfig.json --type-check", + "lint:ts": "tslint --project tsconfig.json", "test": "npm run lint && npm run test:js && npm run test:ts", "test:js": "tap test.js", "test:ts": "tsc --lib ES2015 test_typescript.ts && tap test_typescript.js" diff --git a/test.js b/test.js index 471c0f1..c874ee2 100644 --- a/test.js +++ b/test.js @@ -125,9 +125,10 @@ test('readme', t => { sys.stdout.write(line) sys.stdout.flush() `.then(function () { - fileWriter.end(); - fs.readFileAsync(OUTPUT, {encoding: 'utf8'}).then(x => { - t.equal(x.replace(/\r/g, ''), 'hello\nworld\n') + fileWriter.end(function () { + fs.readFileAsync(OUTPUT, {encoding: 'utf8'}).then(x => { + t.equal(x.replace(/\r/g, ''), 'hello\nworld\n') + }); }); });