Skip to content

Commit

Permalink
chore: Setup CI with github actions (#1924)
Browse files Browse the repository at this point in the history
This uses GitHub actions for linux, windows and osx testing. Travis and appveyor is still present for binary building.
  • Loading branch information
reconbot authored Sep 29, 2019
1 parent 4a3d2a0 commit bae3483
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint
on: [push]

jobs:
test:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

on: [push]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
- name: patch node gyp on windows to support Visual Studio 2019
if: matrix.os == 'windows-latest'
shell: powershell
run: |
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: npm install
run: npm install
- name: npm run rebuild
run: npm run rebuild
- name: npm test
run: npm test
- name: coverage
run: npm run coverage
env:
CI: true
13 changes: 1 addition & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ env:
matrix:
- BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8"
- BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
- TRAVIS_NODE_VERSION="10"
- TRAVIS_NODE_VERSION="12"
matrix:
exclude:
- os: osx
env: TRAVIS_NODE_VERSION="6" ARCH="x86"
- os: osx
env: BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
- os: osx
env: TRAVIS_NODE_VERSION="9" ARCH="x86"

before_install:

Expand Down Expand Up @@ -69,15 +63,10 @@ install:
- npm run rebuild

script:
- npm test

# if publishing, do it
- >
if [[ $PUBLISH_BINARY == true ]]; then
echo "building and uploading binaries"
npm run prebuild;
fi;
after_success:
- npm run coverage

true
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ environment:
matrix:
- nodejs_version: "8"
binary_builder: "true"
- nodejs_version: "10"
- nodejs_version: "12"

platform:
- x86
Expand Down Expand Up @@ -47,15 +45,10 @@ build_script:
- npm run rebuild

test_script:
- npm test

- ps: >
if ($env:publish_binary -eq "true") {
npm run prebuild
}
true;
after_test:
- npm run coverage

deploy: OFF
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ parsers:
coverage:
status:
patch: off
codecov:
token: 262a74e1-f31b-4cd4-a6a1-cdb25c5c2285

0 comments on commit bae3483

Please sign in to comment.