forked from rubyjs/libv8-node
-
-
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.
Improve local build and test tooling
- Loading branch information
Showing
5 changed files
with
77 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
/vendor | ||
/Gemfile.lock | ||
*.gem | ||
/Makefile | ||
Makefile | ||
*.so | ||
*.bundle | ||
/ext/libv8-node/.location.yml | ||
/test/mini_racer |
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 |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
/Gemfile.lock | ||
*.gem | ||
Makefile | ||
/ext/libv8-node/.location.yml | ||
/test/mini_racer |
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,45 @@ | ||
PWD := $(shell pwd) | ||
VERSION := $(shell ./libexec/metadata version) | ||
NODE_VERSION := $(shell ./libexec/metadata node_version) | ||
|
||
all: | ||
|
||
pkg/libv8-node-$(VERSION)-x86_64-linux.gem: | ||
docker build --platform linux/amd64 --build-arg RUBY_VERSION=2.3 --progress plain -t libv8-node:gnu . | ||
docker run --platform linux/amd64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:gnu cp $@ /pkg/ | ||
|
||
pkg/libv8-node-$(VERSION)-x86_64-linux-musl.gem: | ||
docker build --platform linux/amd64 --build-arg RUBY_VERSION=2.4-alpine --progress plain -t libv8-node:musl . | ||
docker run --platform linux/amd64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:musl cp $@ /pkg/ | ||
|
||
pkg/libv8-node-$(VERSION)-aarch64-linux.gem: | ||
docker build --platform linux/arm64 --build-arg RUBY_VERSION=2.3 --progress plain -t libv8-node:gnu . | ||
docker run --platform linux/arm64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:gnu cp $@ /pkg/ | ||
|
||
pkg/libv8-node-$(VERSION)-aarch64-linux-musl.gem: | ||
docker build --platform linux/arm64 --build-arg RUBY_VERSION=2.4-alpine --progress plain -t libv8-node:musl . | ||
docker run --platform linux/arm64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:musl cp $@ /pkg/ | ||
|
||
test/x86_64-linux: pkg/libv8-node-$(VERSION)-x86_64-linux.gem | ||
test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 | ||
cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x | ||
ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"15.12.0.0.beta1\"\n") : print' test/mini_racer/lib/mini_racer/version.rb | ||
docker run --platform linux/amd64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:gnu sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' | ||
|
||
test/x86_64-linux-musl: pkg/libv8-node-$(VERSION)-x86_64-linux-musl.gem | ||
test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 | ||
cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x | ||
ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"15.12.0.0.beta1\"\n") : print' test/mini_racer/lib/mini_racer/version.rb | ||
docker run --platform linux/amd64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:musl sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' | ||
|
||
test/aarch64-linux: pkg/libv8-node-$(VERSION)-aarch64-linux.gem | ||
test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 | ||
cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x | ||
ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"15.12.0.0.beta1\"\n") : print' test/mini_racer/lib/mini_racer/version.rb | ||
docker run --platform linux/arm64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:gnu sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' | ||
|
||
test/aarch64-linux-musl: pkg/libv8-node-$(VERSION)-aarch64-linux-musl.gem | ||
test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 | ||
cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x | ||
ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"15.12.0.0.beta1\"\n") : print' test/mini_racer/lib/mini_racer/version.rb | ||
docker run --platform linux/arm64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:musl sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' |
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,26 @@ | ||
#!/bin/sh | ||
|
||
case "$1" in | ||
ruby_platform) | ||
ruby -e 'puts RUBY_PLATFORM' | ||
;; | ||
gem_platform) | ||
ruby -e 'puts Gem.platforms.last.to_s' | ||
;; | ||
version) | ||
ruby -I'lib' -r'libv8/node/version' -e 'puts Libv8::Node::VERSION' | ||
;; | ||
node_version) | ||
ruby -I'lib' -r'libv8/node/version' -e 'puts Libv8::Node::NODE_VERSION' | ||
;; | ||
libv8_version) | ||
ruby -I'lib' -r'libv8/node/version' -e 'puts Libv8::Node::LIBV8_VERSION' | ||
;; | ||
libv8_version_h) | ||
# shellcheck disable=SC2016 | ||
ruby -e 'h = File.read("src/node-'"$("$0" node_version)"'/deps/v8/include/v8-version.h"); eval h.each_line.with_object([]) { |l, e| l =~ /#define (V8_[A-Z_]+)\s(\d+)/ && e << "#{$1} = #{$2}" }.join(";"); puts "#{V8_MAJOR_VERSION}.#{V8_MINOR_VERSION}.#{V8_BUILD_NUMBER}.#{V8_PATCH_LEVEL}"' | ||
;; | ||
*) | ||
exit 64 | ||
;; | ||
esac |