httpx/.gitlab-ci.yml
2020-10-02 19:36:49 +01:00

134 lines
2.5 KiB
YAML

stages:
- build
- test
- prepare
- deploy
image: tmaier/docker-compose
variables:
# this variable enables caching withing docker-in-docker
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-workflow-with-docker-executor
MOUNT_POINT: /builds/$CI_PROJECT_PATH/vendor
# bundler-specific
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor
services:
- docker:dind
# Cache gems in between builds
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- vendor
test_jruby:
stage: test
script:
./spec.sh jruby 9.0.0.0
allow_failure: true
artifacts:
paths:
- coverage/
test_ruby21:
stage: test
script:
./spec.sh ruby 2.1
artifacts:
paths:
- coverage/
test_ruby22:
only:
- master
stage: test
script:
./spec.sh ruby 2.2
test_ruby23:
only:
- master
stage: test
script:
./spec.sh ruby 2.3
test_ruby24:
only:
- master
stage: test
script:
./spec.sh ruby 2.4
test_ruby25:
only:
- master
stage: test
script:
./spec.sh ruby 2.5
test_ruby26:
only:
- master
stage: test
script:
./spec.sh ruby 2.6
test_ruby27:
stage: test
script:
./spec.sh ruby 2.7
artifacts:
paths:
- coverage/
jekyll:
stage: test
image: "ruby:2.7-alpine"
variables:
JEKYLL_ENV: production
script:
- apk --update add g++ make
- gem install hanna-nouveau
- rake prepare_website
- cd www
- bundle install
- bundle exec jekyll build -d public
artifacts:
paths:
- www/public/
- www/rdoc/
coverage:
stage: prepare
dependencies:
- test_jruby
- test_ruby21
- test_ruby27
image: "ruby:2.7-alpine"
script:
# this is a workaround, because simplecov doesn't support relative paths.
#
# https://github.com/simplecov-ruby/simplecov/issues/887
#
# this is necessary in our case, because coverage files are generated inside
# the custom docker container, which runs in /home, and the absolute paths aren't
# gonna match the paths where the files are, once we merge them. Therefore,
# all of those have to be rewritten before the merge happens.
#
- find coverage -name "*resultset.json" -exec sed -i 's?/home?'`pwd`'?' {} \;
- gem install --no-doc simplecov
- rake coverage:report
artifacts:
paths:
- "coverage/"
pages:
stage: deploy
dependencies:
- coverage
- jekyll
script:
- mv www/public .
- mv coverage public
artifacts:
paths:
- public
expire_in: 30 days
only:
- master