diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..11737170 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: ci +on: + - pull_request + - push + +jobs: + Test: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + node_version: + - 10 + - 12 + - 14 + name: Node ${{ matrix.node_version }} on ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Cache + uses: actions/cache@v2 + with: + path: | + 'node_modules' + key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json') }} + + - name: Setup node + uses: actions/setup-node@v2-beta + with: + node-version: ${{ matrix.node_version }} + + - name: Install dependencies + run: npm install + + - name: Lint + run: npm run standard + + - name: Run tests + run: | + npm run test:node + npm run test:native + + Skip: + if: contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest + steps: + - name: Skip CI 🚫 + run: echo skip ci diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1831c829..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: node_js -sudo: false - -notifications: - email: - on_success: never - on_failure: change - -node_js: - - "8" - - "10" - - "12.14.1" - -before_install: - - export CXX="g++-4.9" CC="gcc-4.9" - -script: - - npm run standard - - npm run test:node - - npm run test:native - -git: - depth: 10 - -branches: - only: - - master - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-4.9 - - g++-4.9 diff --git a/appveyor.yml b/appveyor.yml index aa43e41e..795da41c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,27 +1,6 @@ -image: Visual Studio 2015 - -environment: - matrix: - - nodejs_version: "8" - - nodejs_version: "12.14.1" - -platform: - - x86 - - x64 - -install: - - ps: Install-Product node $env:nodejs_version - - git submodule update --init - - node --version - - npm --version - - npm install - -test_script: - - npm run standard - - npm run test:node - +# empty appveyor build: off branches: only: - - master + - non-existing diff --git a/package.json b/package.json index b514e5c6..c2d237bc 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build:node": "node-gyp rebuild", "build:browser": "script/build-browser-version.sh", "build": "npm run build:node && npm run build:browser", - "test:native": "script/test-native.js", + "test:native": "node ./script/test-native.js", "test:node": "mocha test/js/*.js", "test:browser": "SUPERSTRING_USE_BROWSER_VERSION=1 mocha test/js/*.js", "test": "npm run test:node && npm run test:browser",