From 6445f635afa5d9b9a0ba7db72b64ba51289787ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Mon, 3 May 2021 18:39:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B9=20Switch=20CI=20to=20GitHub=20Acti?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ .travis.yml | 33 --------------------------------- test/xattr.js | 13 +++++++------ 3 files changed, 31 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..14d556b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Node CI + +on: + pull_request: + branches: + - master + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macOS-latest] + node: [8.6.0, 10.0.0, 12.0.0] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 139363f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: node_js - -matrix: - include: - - # For Node.js 4 and up we need to install C++11 compatible compiler - # Travis' Linux machines doesn't support xattrs, just try building - - node_js: '8' - install: [npm install --ignore-scripts] - script: [npm install, npm run lint] - addons: {apt: {sources: [ubuntu-toolchain-r-test], packages: [g++-4.8]}} - env: [CXX=g++-4.8] - os: linux - - node_js: '10' - install: [npm install --ignore-scripts] - script: [npm install, npm run lint] - addons: {apt: {sources: [ubuntu-toolchain-r-test], packages: [g++-4.8]}} - env: [CXX=g++-4.8] - os: linux - - node_js: '12' - install: [npm install --ignore-scripts] - script: [npm install, npm run lint] - addons: {apt: {sources: [ubuntu-toolchain-r-test], packages: [g++-4.8]}} - env: [CXX=g++-4.8] - os: linux - - # Normal build for OS X - - node_js: '8' - os: osx - - node_js: '10' - os: osx - - node_js: '12' - os: osx diff --git a/test/xattr.js b/test/xattr.js index 62cffb1..e33005a 100644 --- a/test/xattr.js +++ b/test/xattr.js @@ -5,6 +5,7 @@ const xattr = require('../') const fs = require('fs') +const os = require('os') const temp = require('fs-temp') const assert = require('assert') const crypto = require('crypto') @@ -47,8 +48,8 @@ describe('xattr#sync', function () { assert.throws(function () { xattr.getSync(path, attribute0) }, function (err) { - assert.strictEqual(err.errno, 93) - assert.strictEqual(err.code, 'ENOATTR') + assert.strictEqual(err.errno, os.platform() === 'darwin' ? 93 : 61) + assert.strictEqual(err.code, os.platform() === 'darwin' ? 'ENOATTR' : 'ENODATA') return true }) }) @@ -98,8 +99,8 @@ describe('xattr#async', function () { } assert(err) - assert.strictEqual(err.errno, 93) - assert.strictEqual(err.code, 'ENOATTR') + assert.strictEqual(err.errno, os.platform() === 'darwin' ? 93 : 61) + assert.strictEqual(err.code, os.platform() === 'darwin' ? 'ENOATTR' : 'ENODATA') }) after(function (done) { @@ -144,8 +145,8 @@ describe('xattr#utf8', function () { } assert(err) - assert.strictEqual(err.errno, 93) - assert.strictEqual(err.code, 'ENOATTR') + assert.strictEqual(err.errno, os.platform() === 'darwin' ? 93 : 61) + assert.strictEqual(err.code, os.platform() === 'darwin' ? 'ENOATTR' : 'ENODATA') }) after(function (done) {