httpx/test/support/ci/build.sh
2020-10-02 19:36:49 +01:00

36 lines
886 B
Bash
Executable File

#!/bin/sh
RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
if [[ "$RUBY_PLATFORM" = "java" ]]; then
apk --update add make git bash iptables
elif [[ ${RUBY_VERSION:0:3} = "2.1" ]]; then
apk --update add g++ make git bash libsodium iptables
else
apk --update add g++ make git bash iptables
fi
# use port 9090 to test connection timeouts
CONNECT_TIMEOUT_PORT=9090
iptables -A OUTPUT -p tcp -m tcp --tcp-flags SYN SYN --sport $CONNECT_TIMEOUT_PORT -j DROP
export CONNECT_TIMEOUT_PORT=$CONNECT_TIMEOUT_PORT
export PATH=$GEM_HOME/bin:$BUNDLE_PATH/gems/bin:$PATH
mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
gem install bundler -v="1.17.3" --no-doc --conservative
cd /home
bundle install
bundle exec rake test:ci
RET=$?
RUBY_VERSION=`ruby -e 'puts RUBY_VERSION'`
if [[ $RET = 0 ]] && [[ ${RUBY_VERSION:0:3} = "2.7" ]]; then
RUBYOPT="--jit" bundle exec rake test:ci
fi
exit $RET