From f13a8634db08e3a96a89edf13b7c111069ca35d0 Mon Sep 17 00:00:00 2001 From: fscherwi Date: Tue, 23 Feb 2016 08:41:11 +0100 Subject: [PATCH 1/5] update to latest build-package.sh --- build-package.sh | 72 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/build-package.sh b/build-package.sh index 02457dd..d21ce2e 100644 --- a/build-package.sh +++ b/build-package.sh @@ -1,44 +1,82 @@ #!/bin/sh echo "Downloading latest Atom release..." -curl -s -L "https://atom.io/download/mac" \ - -H 'Accept: application/octet-stream' \ - -o atom.zip +ATOM_CHANNEL="${ATOM_CHANNEL:=stable}" + +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + curl -s -L "https://atom.io/download/mac?channel=$ATOM_CHANNEL" \ + -H 'Accept: application/octet-stream' \ + -o "atom.zip" + mkdir atom + unzip -q atom.zip -d atom + if [ "$ATOM_CHANNEL" = "stable" ]; then + export ATOM_APP_NAME="Atom.app" + export ATOM_SCRIPT_NAME="atom.sh" + export ATOM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" + else + export ATOM_APP_NAME="Atom ${ATOM_CHANNEL}.app" + export ATOM_SCRIPT_NAME="atom-${ATOM_CHANNEL}" + export ATOM_SCRIPT_PATH="./atom-${ATOM_CHANNEL}" + ln -s "./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" "${ATOM_SCRIPT_PATH}" + fi + export PATH="$PWD/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/bin:$PATH" + export ATOM_PATH="./atom" + export APM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/apm" +else + curl -s -L "https://atom.io/download/deb?channel=$ATOM_CHANNEL" \ + -H 'Accept: application/octet-stream' \ + -o "atom.deb" + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 + export DISPLAY=":99" + dpkg-deb -x atom.deb "$HOME/atom" + if [ "$ATOM_CHANNEL" = "stable" ]; then + export ATOM_SCRIPT_NAME="atom" + export APM_SCRIPT_NAME="apm" + else + export ATOM_SCRIPT_NAME="atom-$ATOM_CHANNEL" + export APM_SCRIPT_NAME="apm-$ATOM_CHANNEL" + fi + export ATOM_SCRIPT_PATH="$HOME/atom/usr/bin/$ATOM_SCRIPT_NAME" + export APM_SCRIPT_PATH="$HOME/atom/usr/bin/$APM_SCRIPT_NAME" +fi -mkdir atom -unzip -q atom.zip -d atom -export PATH=$PWD/atom/Atom.app/Contents/Resources/app/apm/bin:$PATH echo "Using Atom version:" -ATOM_PATH=./atom ./atom/Atom.app/Contents/Resources/app/atom.sh -v +"$ATOM_SCRIPT_PATH" -v +echo "Using APM version:" +"$APM_SCRIPT_PATH" -v echo "Downloading package dependencies..." -atom/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm clean -atom/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm install +"$APM_SCRIPT_PATH" clean +"$APM_SCRIPT_PATH" install TEST_PACKAGES="${APM_TEST_PACKAGES:=none}" if [ "$TEST_PACKAGES" != "none" ]; then echo "Installing atom package dependencies..." for pack in $TEST_PACKAGES ; do - atom/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm install $pack + "$APM_SCRIPT_PATH" install $pack done fi if [ -f ./node_modules/.bin/coffeelint ]; then - if [ -d ./src ]; then + if [ -d ./lib ]; then echo "Linting package..." - ./node_modules/.bin/coffeelint src - rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi + ./node_modules/.bin/coffeelint lib + rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi fi if [ -d ./spec ]; then echo "Linting package specs..." ./node_modules/.bin/coffeelint spec - rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi + rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi fi fi -echo "Running specs..." -ATOM_PATH=./atom atom/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm test --path atom/Atom.app/Contents/Resources/app/atom.sh - +if [ -d ./spec ]; then + echo "Running specs..." + "$ATOM_SCRIPT_PATH" --test spec +else + echo "Missing spec folder! Please consider adding a test suite in `./spec`" + exit 1 +fi exit From 194b76283fba3c6f7afc9939cbfd68d04fcbd8a1 Mon Sep 17 00:00:00 2001 From: fscherwi Date: Tue, 23 Feb 2016 08:43:54 +0100 Subject: [PATCH 2/5] run stable and beta release on linux and osx --- .travis.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27928a8..4628975 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ -language: objective-c +sudo: false -osx_image: beta-xcode6.2 +os: + - linux + - osx git: depth: 10 @@ -19,7 +21,11 @@ notifications: script: sh build-package.sh env: + global: - APM_TEST_PACKAGES="language-marko language-html-swig language-svg language-d mavensmate-atom" + matrix: + - ATOM_CHANNEL=stable + - ATOM_CHANNEL=beta cache: - pip: true @@ -64,3 +70,11 @@ before_install: # Elm - curl -L -o /tmp/elm-format.tgz https://github.com/avh4/elm-format/releases/download/0.1-alpha2/elm-format-0.1-alpha2-mac-x64.tgz - tar xvzf /tmp/elm-format.tgz -C /usr/local/bin + +addons: + apt: + packages: + - build-essential + - git + - libgnome-keyring-dev + - fakeroot From ad431fda81e8527841bb3a51b28e4cc5f72277a8 Mon Sep 17 00:00:00 2001 From: fscherwi Date: Tue, 23 Feb 2016 08:48:54 +0100 Subject: [PATCH 3/5] only build on osx --- .travis.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4628975..fad2d95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ -sudo: false +language: objective-c -os: - - linux - - osx +osx_image: beta-xcode6.2 + +sudo: false git: depth: 10 @@ -70,11 +70,3 @@ before_install: # Elm - curl -L -o /tmp/elm-format.tgz https://github.com/avh4/elm-format/releases/download/0.1-alpha2/elm-format-0.1-alpha2-mac-x64.tgz - tar xvzf /tmp/elm-format.tgz -C /usr/local/bin - -addons: - apt: - packages: - - build-essential - - git - - libgnome-keyring-dev - - fakeroot From 86ec741ecb30e7e9b2c4496f7745dded4393bed1 Mon Sep 17 00:00:00 2001 From: fscherwi Date: Tue, 23 Feb 2016 11:30:49 +0100 Subject: [PATCH 4/5] fix linting --- build-package.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-package.sh b/build-package.sh index d21ce2e..b135968 100644 --- a/build-package.sh +++ b/build-package.sh @@ -60,9 +60,9 @@ if [ "$TEST_PACKAGES" != "none" ]; then fi if [ -f ./node_modules/.bin/coffeelint ]; then - if [ -d ./lib ]; then + if [ -d ./src ]; then echo "Linting package..." - ./node_modules/.bin/coffeelint lib + ./node_modules/.bin/coffeelint src rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi fi if [ -d ./spec ]; then From 6e1c30cf7208b821fc86e079f935a8bee33b4c78 Mon Sep 17 00:00:00 2001 From: fscherwi Date: Tue, 23 Feb 2016 11:32:59 +0100 Subject: [PATCH 5/5] run on latest xcode image --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fad2d95..101b8be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: objective-c -osx_image: beta-xcode6.2 +osx_image: xcode7.3 sudo: false