From 18706cecc65d47594f29d39fb699effe3cb18ee8 Mon Sep 17 00:00:00 2001 From: cschanaj Date: Mon, 17 Apr 2023 09:43:29 +0800 Subject: [PATCH] ci: use github actions to replace travis ci --- .github/workflows/node.js.yml | 40 ++++++++++++++++++++++ .travis.yml | 54 ------------------------------ Readme.md | 3 +- appveyor.yml | 62 ----------------------------------- 4 files changed, 41 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/node.js.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..81c57c5 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,40 @@ +# 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: ${{ matrix.os }} + + strategy: + matrix: + node-version: [ 10, 11, 12, 13, 14, 15, 16, 17, 18 ] + os: [ macos-latest, ubuntu-latest, windows-latest ] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + if: ${{ matrix.os != 'windows-latest' }} + run: | + export NVM_DIR="$HOME/.nvm" + source "$NVM_DIR/nvm.sh" + nvm install ${{ matrix.node-version }} + nvm install-latest-npm + - name: Run npm install --build-from-source + run: npm install --build-from-source + - run: npm test + - run: node example.js + - name: Publish binaries + if: ${{ contains(github.event.commits[0].message, '[publish binary]') && github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.os != 'windows-latest' }} + run: ./node_modules/.bin/node-pre-gyp package unpublish publish info + - name: Publish Windows binaries + if: ${{ contains(github.event.commits[0].message, '[publish binary]') && github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.os == 'windows-latest' }} + run: cmd /c 'node_modules\.bin\node-pre-gyp package unpublish publish info' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 655dd61..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: cpp - -os: - - linux - - osx - -dist: focal - -env: - matrix: - - NODE_VERSION="10" - - NODE_VERSION="11" - - NODE_VERSION="12" - - NODE_VERSION="13" - - NODE_VERSION="14" - - NODE_VERSION="15" - - NODE_VERSION="16" - - NODE_VERSION="17" - - global: - - secure: "qcCCx495V8ocKfd2fRhhbWR61rVdBBf2SVcAIhKQuGc/UluzoT4ctAEqs9J6C0bBW//wPFE6xwaegQ27+e6bcOqwSjKHFDOb+P75/qMqagVms+iftEbLlXQQrZPu7sT8uLb8Aqll+fz5UrgZuEZV1zS92rwKqEcchlbHYRWNbRUPWmItiUZdxxYL3bt7M8RwMBFals7iaqRrru4urSaWHscbZ5czGewfRXW4w1uT6Q9+52QH07SH/zJMppGrSFJKO3Bk7vQgo+657T7sw5pGKjH1JX/jUpKCKDelgPZ48E/ZV1bNsmMoH5tcNKBEJQmJBfFZjdvTWvZ4Huwk9Lyc5i3OREWD4v4qDGPDs36lVBnLjnBvkekpWkxRa7O87hQ77v5LU17f7pwEFBntYm/MQdBJshyxiivDQIf7VqByeuUTn370tOZ3DqZpwtCyFJRcLFLxp3rSXsC+zR0HeW3/bS5EVNByTHy4FHefkCMO3mCMj7miQ7X5fwixxDDl+srzHsR3rvQkMlpPMvBvSWul+tznAJV+N3cK7KrV3tT1PRYBi+pzA5JnBoSMdfF0BhWaPnf7YN53vy62GB8oy0azEb0AHmXCX1p6RcS5iNM44mk8GCXYKz8le1wmlYodSgo/hMxuOc9JnAlgsbhRexTYpErlfOUs58RdNDf1ImO54U4=" - - secure: "Oi/pws08wfmxUpJB2ECb9LisFLqNfutmi2XHWRnPZjH3T4bnctTm2tJTcZC9DTeUwa6HQy+GmBe30ybKKWEjF6U77q7ljfAUM6Ky/w1BAb/TLnDXfophM39qE6GJsxO81iB6d8WYE6HRZftwnJWqA26oMz2AdE5l7ayBds0dwnhHFtRn+f2zNuG2AZoxMEUWvngPHR9wAHaddHpKs2vnZdXXQOkKm+U4vouqyd0pkayjx1Nq09GrWEe/bjs6RV5YAL1mpdvxA8i87bX8DqmwyE2le2HYaWNysF53eJe8baCU21LKkbnl1EJfPvpbbs8lagoitnhq5fZHuoPEajHw0D/uy7oR7f3M6InqKTqAWFcSFsF2e6CyxHKHbL82KGi5cDxak6bZNZsjoR57IchS3pANEkAqBzHl776KALPpw9aVbiwgbPV96/NdVSZaAE58WW2xQjmUBUh6Ns2bQWa9GsGvG7wHEUx7gQNtiicpwWDvlPjiSj06uqWHyiPJrNxI07r3uFTKZJtChqkoKX8COxhr7jWrWlzfIOU0tjBJKUochLvVoe3+LLVSJRis7f8g72R5KE4dDPYBHM/NVqsi1sQFGhHOsRB2yZMowEwV/1e/q18jrOe0G8srYG7XJABPPQZaf1R9Y8PjJon+FvfuqtlCjQOz1I5XHrngGceoX3o=" - - -sudo: false - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - -before_install: - - export CXX=g++ - - export CC=gcc - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CC=gcc-9 CXX=g++-9; fi - - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm - - source ~/.nvm/nvm.sh - - nvm install $NODE_VERSION - - nvm use $NODE_VERSION - - export PATH=$(pwd)/node_modules/.bin:${PATH} - - npm install -g npm@6 - -install: - - npm install --build-from-source - -script: - - node --version - - npm --version - - npm test - - node example.js - - COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\n') - - if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp package unpublish publish info; fi; diff --git a/Readme.md b/Readme.md index 2046bda..5eff7b3 100644 --- a/Readme.md +++ b/Readme.md @@ -19,8 +19,7 @@ Installation should just be: npm install tulind ``` -It should work on Windows, Os X, and Linux. Node version 10, 11, 12, 13, 14 (LTS), -15 and 16 are tested and supported on each platform. +It should work on Windows, Os X, and Linux. Node version 10+ are tested and supported on each platform. Note that pre-compiled binaries are available for Windows. For other platforms you will need a C++ build environment installed. On Linux based distributions diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8dafebf..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,62 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml - - -environment: - AWS_ACCESS_KEY_ID: - secure: GOBrUyHVMfZSrmsS4I63fC+E3qploEcIuQc/ofuTK5U= - - AWS_SECRET_ACCESS_KEY: - secure: QBSKf6NBLUrjkk7ft4H8LyxATdcJ8PmQObKqDgl1qQmT0ju7r3l/D6t8MN2joQqk - - matrix: - - nodejs_version: 10 - - nodejs_version: 11 - - nodejs_version: 12 - - nodejs_version: 13 - - nodejs_version: 14 - - nodejs_version: 15 - - nodejs_version: 16 - - nodejs_version: 17 - -platform: - - x64 - - x86 - -shallow_clone: true - -install: - - ps: Install-Product node $env:nodejs_version $env:Platform - # npm 6.x is the latest version bundled with Node LTS 14.x - - npm install -g npm@6 - - ps: $env:path = $env:appdata + "\npm;" + $env:path - - # work around an issue with node-gyp v3.3.1 and node 4x - # package.json has no certificates in it so we're cool - # https://github.com/nodejs/node-gyp/issues/921 - - ps: npm config set -g cafile=package.json | Write-Host; - - ps: npm config set -g strict-ssl=false | Write-Host; - - # Add local node-pre-gyp dir to path - - SET PATH=node_modules\.bin;%PATH% - # Use 64-bit Python if platform is 64-bit - - IF "%platform%" == "x64" SET "PATH=C:\Python27-x64;%PATH%" - - IF "%platform%" == "x64" CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64 - - IF "%platform%" == "x86" CALL "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 - # Print some information - - node -v - - npm -v - # Build - - npm install --build-from-source --msvs_version=2015 - - npm test - - npm ls - - SET PATH=node_modules\.bin;%PATH% - - ps: >- - if ($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains("[publish binary]")) { - cmd /c 'node_modules\.bin\node-pre-gyp --msvs_version=2015 package unpublish publish info 2>&1' - } - - - -build: off -test: off -deploy: off