parametrized spec script, setting gitlab CI

This commit is contained in:
HoneyryderChuck 2018-02-14 00:02:05 +00:00
parent 5193aeab92
commit 8e4934b377
10 changed files with 37 additions and 88 deletions

View File

@ -1,86 +1,27 @@
image: tmaier/docker-compose
services:
- docker:dind
before_script:
- ruby -v
- uname -v
- apk update
- apk add git make g++
- gem install bundler --no-doc
- bundle install --jobs 4
- docker info
- docker-compose --version
.with_ruby21: &ruby21
image: "ruby:2.1-alpine"
cache:
key: "ruby21"
paths:
- vendor
only:
- master
.with_ruby22: &ruby22
image: "ruby:2.2-alpine"
cache:
key: "ruby22"
paths:
- vendor
only:
- master
.with_ruby23: &ruby23
image: "ruby:2.3-alpine"
cache:
key: "ruby23"
paths:
- vendor
only:
- master
.with_ruby24: &ruby24
image: "ruby:2.4-alpine"
cache:
key: "ruby24"
paths:
- vendor
only:
- master
.with_ruby25: &ruby25
image: "ruby:2.5-alpine"
cache:
key: "ruby25"
paths:
- vendor
only:
- master
.with_jruby9000: &jruby
image: "jruby:9.1-alpine"
cache:
key: "jruby"
paths:
- vendor
only:
- master
.with_tests: &tests
test_ruby21:
script:
- PARALLEL=1 MT_HELL=1 bundle exec rake test
- PARALLEL=1 MT_HELL=1 NIO=1 bundle exec rake test
- bundle exec rake rubocop
test:ruby21:
<<: *ruby21
<<: *tests
test:ruby22:
<<: *ruby22
<<: *tests
test:ruby23:
<<: *ruby23
<<: *tests
test:ruby24:
<<: *ruby24
<<: *tests
test:ruby25:
<<: *ruby25
<<: *tests
test:jruby:
<<: *jruby
<<: *tests
./spec.sh ruby 2.1
test_ruby22:
script:
./spec.sh ruby 2.2
test_ruby23:
script:
./spec.sh ruby 2.3
test_ruby24:
script:
./spec.sh ruby 2.4
test_ruby25:
script:
./spec.sh ruby 2.5
test_jruby:
script:
./spec.sh jruby 9.0.0.0

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
ruby RUBY_VERSION
source "https://rubygems.org"

View File

@ -11,7 +11,7 @@ services:
- HTTPX_SOCKS5_PROXY=socks5://socksproxy:8080
- PARALLEL=1
- CI=1
image: ruby:2.4-alpine
image: ruby:latest-alpine
depends_on:
- httpproxy
- socksproxy

13
spec.sh
View File

@ -1,14 +1,21 @@
#!/bin/sh
RUBY=$1
VERSION=$2
cleanup () {
docker-compose -p ci kill
docker-compose -p ci rm -f --all
}
docker build -t httpx -f test/support/ci/Dockerfile .
if [ -z $VERSION ]; then
extra=""
else
extra="-f docker-compose-${RUBY}-${VERSION}.yml"
fi
docker-compose -f test/support/ci/docker-compose.yml -p ci build
docker-compose -f test/support/ci/docker-compose.yml -p ci up httpx \
docker-compose -f docker-compose.yml ${extra} -p ci build
docker-compose -f docker-compose.yml ${extra} -p ci up \
--exit-code-from httpx \
--abort-on-container-exit

View File

@ -1,6 +1,6 @@
#!/bin/sh
apk update && apk upgrade
apk add --no-cache g++ make git bash
cd /home && rm Gemfile.lock && bundle install && bundle exec rake test:ci
cd /home && touch Gemfile.lock && rm Gemfile.lock && bundle install && bundle exec rake test:ci