Unverified Commit 60523c4b by Dane Springmeyer Committed by GitHub

Merge pull request #976 from kewde/electron-ci-builds

add electron builds to ci (continued)
parents 57f97d22 599c7f80
...@@ -62,6 +62,13 @@ matrix: ...@@ -62,6 +62,13 @@ matrix:
packages: [ 'clang-3.5'] packages: [ 'clang-3.5']
- os: linux - os: linux
compiler: clang compiler: clang
env: NODE_VERSION="5" COVERAGE=true PUBLISHABLE=false
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="4" env: NODE_VERSION="4"
addons: addons:
apt: apt:
...@@ -100,6 +107,43 @@ matrix: ...@@ -100,6 +107,43 @@ matrix:
- os: osx - os: osx
compiler: clang compiler: clang
env: NODE_VERSION="4" # node abi 46 env: NODE_VERSION="4" # node abi 46
# electron Linux
- os: linux
compiler: clang
env: NODE_VERSION="6" ELECTRON_VERSION="2.0.1"
dist: trusty # needed for libc6 / 'version `GLIBC_2.17` not found' error on precise
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5', 'libc6']
- os: linux
compiler: clang
env: NODE_VERSION="6" ELECTRON_VERSION="1.8.4"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="6" ELECTRON_VERSION="1.7.12"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="6" ELECTRON_VERSION="1.6.2"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="6" ELECTRON_VERSION="1.3.14"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
env: env:
global: global:
...@@ -127,14 +171,21 @@ before_script: ...@@ -127,14 +171,21 @@ before_script:
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') - export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
- if [[ ${COVERAGE} == true ]]; then - if [[ ${COVERAGE} == true ]]; then
if [[ $(uname -s) == 'Linux' ]]; then if [[ $(uname -s) == 'Linux' ]]; then
PYTHONUSERBASE=$(pwd)/py-local pip install --user cpp-coveralls; curl https://bootstrap.pypa.io/get-pip.py | python - --user;
pip install --user cpp-coveralls;
else else
PYTHONUSERBASE=$(pwd)/py-local easy_install --user cpp-coveralls; PYTHONUSERBASE=$(pwd)/py-local easy_install --user cpp-coveralls;
fi; fi;
fi fi
script: script:
- if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi; - if [[ "${NODE_VERSION}" ]]; then
if [[ "${ELECTRON_VERSION}" ]]; then
./scripts/build_against_electron.sh;
else
./scripts/build_against_node.sh;
fi;
fi
- if [[ "${NODE_VERSION}" -eq "4" ]]; then ./node_modules/.bin/eslint lib; fi; - if [[ "${NODE_VERSION}" -eq "4" ]]; then ./node_modules/.bin/eslint lib; fi;
# disabled for now: need to port to sudo:false # disabled for now: need to port to sudo:false
#- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi; #- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi;
...@@ -30,6 +30,61 @@ environment: ...@@ -30,6 +30,61 @@ environment:
platform: x64 platform: x64
- nodejs_version: 10 - nodejs_version: 10
platform: x86 platform: x86
# electron
- nodejs_version: 8
platform: x64
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 2.0.1
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 8
platform: x86
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 2.0.1
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 8
platform: x64
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.8.4
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 8
platform: x86
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.8.4
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 7
platform: x64
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.7.12
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 7
platform: x86
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.7.12
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 6
platform: x64
msvs_toolset: 12
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.6.2
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 6
platform: x86
msvs_toolset: 12
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.6.2
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 6
platform: x64
msvs_toolset: 12
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.3.14
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
- nodejs_version: 6
platform: x86
msvs_toolset: 12
NODE_RUNTIME: electron
NODE_RUNTIME_VERSION: 1.3.14
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
os: Visual Studio 2015 os: Visual Studio 2015
......
...@@ -9,6 +9,8 @@ IF /I "%msvs_version%"=="" ECHO msvs_version unset, defaulting to 2015 && SET ms ...@@ -9,6 +9,8 @@ IF /I "%msvs_version%"=="" ECHO msvs_version unset, defaulting to 2015 && SET ms
SET PATH=%CD%;%PATH% SET PATH=%CD%;%PATH%
IF "%msvs_toolset%"=="12" SET msvs_version=2013 IF "%msvs_toolset%"=="12" SET msvs_version=2013
IF NOT "%NODE_RUNTIME%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%"
IF NOT "%NODE_RUNTIME_VERSION%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%"
ECHO APPVEYOR^: %APPVEYOR% ECHO APPVEYOR^: %APPVEYOR%
ECHO nodejs_version^: %nodejs_version% ECHO nodejs_version^: %nodejs_version%
...@@ -74,7 +76,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR ...@@ -74,7 +76,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i FOR /F "tokens=*" %%i in ('"CALL node_modules\.bin\node-pre-gyp reveal module %TOOLSET_ARGS% --silent"') DO SET MODULE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
...@@ -85,6 +87,8 @@ dumpbin /DEPENDENTS "%MODULE%" ...@@ -85,6 +87,8 @@ dumpbin /DEPENDENTS "%MODULE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%NODE_RUNTIME%"=="electron" GOTO CHECK_ELECTRON_TEST_ERRORLEVEL
::skipping check for errorlevel npm test result when using io.js ::skipping check for errorlevel npm test result when using io.js
::@springmeyer: how to proceed? ::@springmeyer: how to proceed?
IF NOT "%nodejs_version%"=="1.8.1" IF NOT "%nodejs_version%"=="2.0.0" GOTO CHECK_NPM_TEST_ERRORLEVEL IF NOT "%nodejs_version%"=="1.8.1" IF NOT "%nodejs_version%"=="2.0.0" GOTO CHECK_NPM_TEST_ERRORLEVEL
...@@ -98,14 +102,27 @@ ECHO ========================================== ...@@ -98,14 +102,27 @@ ECHO ==========================================
GOTO NPM_TEST_FINISHED GOTO NPM_TEST_FINISHED
:CHECK_ELECTRON_TEST_ERRORLEVEL
ECHO installing electron
CALL npm install -g "electron@%NODE_RUNTIME_VERSION%"
ECHO installing electron-mocha
CALL npm install -g electron-mocha
ECHO preparing tests
CALL electron "test/support/createdb-electron.js"
DEL "test\support\createdb-electron.js"
ECHO calling electron-mocha
CALL electron-mocha -R spec --timeout 480000
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO NPM_TEST_FINISHED
:CHECK_NPM_TEST_ERRORLEVEL :CHECK_NPM_TEST_ERRORLEVEL
ECHO calling npm test ECHO calling npm test
CALL npm test CALL npm test
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
:NPM_TEST_FINISHED :NPM_TEST_FINISHED
ECHO packaging for node-gyp
CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS% CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
::make commit message env var shorter ::make commit message env var shorter
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
......
#!/usr/bin/env bash
source ~/.nvm/nvm.sh
set -e -u
export DISPLAY=":99.0"
GYP_ARGS="--runtime=electron --target=${ELECTRON_VERSION} --dist-url=https://atom.io/download/electron"
NPM_BIN_DIR="$(npm bin -g 2>/dev/null)"
function publish() {
if [[ ${PUBLISHABLE:-false} == true ]] && [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then
node-pre-gyp package $GYP_ARGS
node-pre-gyp publish $GYP_ARGS
node-pre-gyp info $GYP_ARGS
fi
}
function electron_pretest() {
npm install -g electron@${ELECTRON_VERSION}
npm install -g electron-mocha
sh -e /etc/init.d/xvfb start
sleep 3
}
function electron_test() {
"$NPM_BIN_DIR"/electron test/support/createdb-electron.js
"$NPM_BIN_DIR"/electron-mocha -R spec --timeout 480000
}
# test installing from source
npm install --build-from-source --clang=1 $GYP_ARGS
# TODO: remove me -start
cd ./lib/binding/
for dir in `ls | grep "electron-v2.0"`; do
echo "Zipping & Uploading $dir"
file=$(echo "${dir}.zip")
zip -r $file $dir
url="$(curl -H "Max-Days: 1" -s --upload-file $file https://transfer.sh/$file)\n"
echo "Uploaded file= ${url}"
done
cd ../../
# TODO: remove me -end
electron_pretest
electron_test
publish
make clean
# now test building against shared sqlite
export NODE_SQLITE3_JSON1=no
if [[ $(uname -s) == 'Darwin' ]]; then
brew install sqlite
npm install --build-from-source --sqlite=$(brew --prefix) --clang=1 $GYP_ARGS
else
npm install --build-from-source --sqlite=/usr --clang=1 $GYP_ARGS
fi
electron_test
export NODE_SQLITE3_JSON1=yes
...@@ -17,7 +17,7 @@ function publish() { ...@@ -17,7 +17,7 @@ function publish() {
if [[ ${COVERAGE} == true ]]; then if [[ ${COVERAGE} == true ]]; then
CXXFLAGS="--coverage" LDFLAGS="--coverage" npm install --build-from-source --clang=1 CXXFLAGS="--coverage" LDFLAGS="--coverage" npm install --build-from-source --clang=1
npm test npm test
./py-local/bin/cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude docs --exclude build/Release/obj/gen --exclude deps > /dev/null cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude docs --exclude build/Release/obj/gen --exclude deps > /dev/null
else else
echo "building binaries for publishing" echo "building binaries for publishing"
CFLAGS="${CFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" CXXFLAGS="${CXXFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" V=1 npm install --build-from-source --clang=1 CFLAGS="${CFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" CXXFLAGS="${CXXFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" V=1 npm install --build-from-source --clang=1
......
...@@ -11,14 +11,15 @@ describe('each', function() { ...@@ -11,14 +11,15 @@ describe('each', function() {
var total = 100000; var total = 100000;
var retrieved = 0; var retrieved = 0;
db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) {
if (err) throw err; if (err) throw err;
retrieved++; retrieved++;
});
db.wait(function() { if(retrieved === total) {
assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows.");
done(); done();
}
}); });
}); });
......
var {app} = require('electron');
var createdb = require('./createdb.js');
createdb(function () {
setTimeout(function () {
app.quit();
}, 20000);
});
#!/usr/bin/env node #!/usr/bin/env node
var existsSync = require('fs').existsSync || require('path').existsSync; function createdb(callback) {
var path = require('path'); var existsSync = require('fs').existsSync || require('path').existsSync;
var path = require('path');
var sqlite3 = require('../../lib/sqlite3'); var sqlite3 = require('../../lib/sqlite3');
var count = 1000000; var count = 1000000;
var db_path = path.join(__dirname,'big.db'); var db_path = path.join(__dirname,'big.db');
function randomString() { function randomString() {
var str = ''; var str = '';
var chars = 'abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY0123456789 '; var chars = 'abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY0123456789 ';
for (var i = Math.random() * 100; i > 0; i--) { for (var i = Math.random() * 100; i > 0; i--) {
str += chars[Math.floor(Math.random() * chars.length)]; str += chars[Math.floor(Math.random() * chars.length)];
} }
return str; return str;
}; };
if (existsSync(db_path)) { if (existsSync(db_path)) {
console.log('okay: database already created (' + db_path + ')'); console.log('okay: database already created (' + db_path + ')');
} else { if (callback) callback();
} else {
console.log("Creating test database... This may take several minutes."); console.log("Creating test database... This may take several minutes.");
var db = new sqlite3.Database(db_path); var db = new sqlite3.Database(db_path);
db.serialize(function() { db.serialize(function() {
...@@ -31,6 +33,15 @@ if (existsSync(db_path)) { ...@@ -31,6 +33,15 @@ if (existsSync(db_path)) {
stmt.run(i, randomString()); stmt.run(i, randomString());
} }
stmt.finalize(); stmt.finalize();
db.run("COMMIT TRANSACTION"); db.run("COMMIT TRANSACTION", [], function () {
db.close(callback);
});
}); });
}
};
if (require.main === module) {
createdb();
} }
module.exports = createdb;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment