Skip to content

Commit

Permalink
Create explicit CI job matrix (#585)
Browse files Browse the repository at this point in the history
- Replace matrix expansion with explicit job matrix in `.travis.yml`
- Remove legacy `sudo: false` from `.travis.yml`
- Make prebuilds on Node.js Current instead of 8. Technically this does
  not matter; it's the Node.js headers we build against that matter
  (dictated by the `-t 8.14.0` flag we pass to `prebuildify`). However,
  making the prebuilds on Current means we won't have to change this
  job in the future (e.g. when removing Node.js 8)
- Use tar in AppVeyor too
- Add gzip compression to tar commands and shorten commands
- Rename `linux` to `linux-x64` to communicate absence of `x86`
- Rename `osx` to `darwin-x64`, same, as well as to match node platform
- Rename `win-x64` to `win32-x64`, same
- Create ARM prebuild(s) in separate job, only on tagged commits, skip
  tests and coverage.
  • Loading branch information
vweevers committed Jan 27, 2019
1 parent 1d3dae0 commit 77b1e30
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 24 deletions.
47 changes: 32 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
sudo: false

language: node_js

os:
- osx
- linux
jobs:
include:
- os: linux
node_js: 8
env: [TEST_CMD=test]
- os: linux
node_js: 10
env: [TEST_CMD=test]
- os: linux
node_js: node
env: [TEST_CMD=test, BUILD_CMD=prebuild, BUILD_GROUP=linux-x64]
- os: osx
node_js: 8
env: [TEST_CMD=test]
- os: osx
node_js: 10
env: [TEST_CMD=test]
- os: osx
node_js: node
env: [TEST_CMD=test, BUILD_CMD=prebuild, BUILD_GROUP=darwin-x64]
- name: arm
os: linux
node_js: node
env: [BUILD_CMD=prebuildify-cross-armv7, BUILD_GROUP=arm]
if: tag is present

node_js:
- 8
- 10
- node
script:
- if [[ ! -z "$TEST_CMD" ]]; then npm run $TEST_CMD; fi

after_success:
- npm run coverage
- if [[ ! -z "$TEST_CMD" ]]; then npm run coverage; fi

before_deploy:
- export ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME.tar"
- npm run prebuild
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then npm run prebuildify-cross-armv7; fi
- tar --create --verbose --file="$ARCHIVE_NAME" --directory "$TRAVIS_BUILD_DIR/prebuilds" .
- export ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$BUILD_GROUP.tar.gz"
- npm run $BUILD_CMD
- tar -zcvf "$ARCHIVE_NAME" -C prebuilds .

deploy:
provider: releases
Expand All @@ -28,4 +45,4 @@ deploy:
skip_cleanup: true
on:
tags: true
node: '8'
condition: "! -z $BUILD_CMD"
16 changes: 7 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@ test_script:
- npm --version
- npm test

after_test:
- ps: If ($env:nodejs_version -eq "8") { npm run prebuild }

artifacts:
- path: prebuilds
name: $(APPVEYOR_REPO_TAG_NAME)-win-$(PLATFORM)
type: zip
before_deploy:
- SET ARCHIVE_NAME=%APPVEYOR_REPO_TAG_NAME%-win32-%PLATFORM%.tar.gz
- npm run prebuild
- tar -zcvf "%ARCHIVE_NAME%" -C prebuilds .
- appveyor PushArtifact %ARCHIVE_NAME%

deploy:
- provider: GitHub
artifact: /.*\.zip/
artifact: $(ARCHIVE_NAME)
auth_token:
secure: AjmYV2zeogfen7F6tXvR9PO1zynJVF/jhMCExQ9RMtqEHDMH8Frclym3GniZkEB0
draft: false
on:
appveyor_repo_tag: true
nodejs_version: "8"
nodejs_version: "Current"

0 comments on commit 77b1e30

Please sign in to comment.