forked from rubyjs/mini_racer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rubyjs#1 from sqreen/isolation
Isolation
- Loading branch information
Showing
20 changed files
with
386 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
def test(version, env='') { | ||
node('agent_ruby_build') { | ||
unstash 'git' | ||
|
||
sh "${env} ./test_me.sh ${version}" | ||
} | ||
} | ||
|
||
try { | ||
|
||
stage('Checkout scm') { | ||
node('agent_ruby_build') { | ||
checkout scm | ||
|
||
sh 'git clean -ffdx' | ||
|
||
stash includes: '**/*', name: 'git' | ||
} | ||
} | ||
|
||
stage('Testing') { | ||
parallel(failFast: false, | ||
"1.9.3-p551" : { test("1.9.3-p551") }, | ||
"2.0.0-p647" : { test("2.0.0-p647") }, | ||
"2.2.3" : { test("2.2.3") }, | ||
"2.3.3" : { test("2.3.3") }, | ||
"2.4.3" : { test("2.4.3") }, | ||
"2.5.0" : { test("2.5.0") }, | ||
) | ||
} | ||
|
||
stage('Building 2.3.3') { | ||
node('agent_ruby_build') { | ||
sh './build_me.sh 2.3.3' | ||
|
||
if (env.BRANCH_NAME == 'master') { | ||
archiveArtifacts 'pkg/sq_mini_racer-*.gem' | ||
} | ||
} | ||
} | ||
} catch (e) { | ||
currentBuild.result = "FAILED" | ||
notifyFailed() | ||
throw e | ||
} | ||
|
||
|
||
def notifyFailed() { | ||
slackSend(color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'mini_racer' | ||
MiniRacer::Platform.set_flags! :perf_basic_prof | ||
c = MiniRacer::Context.new | ||
res = nil | ||
script = File.read('small.json'); | ||
c.eval <<JS | ||
var data = #{script}; | ||
function foo() { return data; } | ||
JS | ||
3000.times do | ||
res = c.call('foo') | ||
end | ||
p res.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
rm -rf Gemfile.lock pkg/ | ||
|
||
set -x | ||
|
||
if [ $# -eq 1 ]; then | ||
eval "$(rbenv init -)" | ||
rbenv shell $1 | ||
fi; | ||
|
||
set -e | ||
|
||
ruby --version | ||
gem --version | ||
|
||
rbenv exec bundle install --no-deployment --path vendor/bundle | ||
|
||
rbenv exec bundle exec rake build | ||
|
||
git config user.email "[email protected]" | ||
git config user.name "Jenkins" | ||
|
||
last_gem=pkg/$(ls -t pkg | head -n 1) | ||
|
||
version=$(echo $last_gem | sed 's,pkg/sq_mini_racer-\(.*\).gem,\1,') | ||
|
||
DO_TAG=${SQREEN_TAG_GEM} | ||
|
||
if [ "${DO_TAG}" == "1" ]; then | ||
git tag -a gem-$version -m "Published $(date)" | ||
fi; | ||
|
||
if [ -r "`pwd`/.gem/credentials" ]; then | ||
HOME=`pwd` gem push ${last_gem} -k sqreen_rubygems_api_key | ||
else | ||
echo "Not publishing to rubygems.org (no credentials is `pwd`/.gem/credentials )" | ||
fi | ||
|
||
if [ "${DO_TAG}" == "1" ]; then | ||
if [ -n "${PUBLISH_VERSION}" ]; then | ||
echo "SQREEN_VERSION=$version" > $PUBLISH_VERSION | ||
else | ||
git push origin gem-$version | ||
fi; | ||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef COMPAT_HPP | ||
#define COMPAT_HPP | ||
|
||
#include <ruby.h> | ||
|
||
#ifdef PRIsVALUE | ||
# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj) | ||
# define RB_OBJ_STRING(obj) (obj) | ||
#else | ||
# define PRIsVALUE "s" | ||
# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj) | ||
# define RB_OBJ_STRING(obj) StringValueCStr(obj) | ||
#endif | ||
|
||
#endif // COMPAT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.