httpx/.gitlab-ci.yml
2022-12-02 23:45:57 +00:00

172 lines
3.5 KiB
YAML

stages:
- build
- test
- prepare
- deploy
image:
name: docker/compose:latest
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
.test_settings: &test_settings
variables:
BUNDLE_WITHOUT: website:assorted
stage: test
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
artifacts:
paths:
- coverage/
.jit_matrix: &jit_matrix
parallel:
matrix:
- RUBYOPT: ["", "--jit --jit-warnings --jit-wait"]
.yjit_matrix: &yjit_matrix
parallel:
matrix:
- RUBYOPT: ["", "--jit --jit-warnings --jit-wait", "--yjit"]
# Cache gems in between builds
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- vendor
test jruby:
<<: *test_settings
script:
./spec.sh jruby 9.0.0.0
allow_failure: true
test ruby 2/1:
<<: *test_settings
script:
./spec.sh ruby 2.1
test ruby 2/2:
<<: *test_settings
only:
- master
script:
./spec.sh ruby 2.2
test ruby 2/3:
<<: *test_settings
script:
./spec.sh ruby 2.3
test ruby 2/4:
<<: *test_settings
only:
- master
script:
./spec.sh ruby 2.4
test ruby 2/5:
<<: *test_settings
only:
- master
script:
./spec.sh ruby 2.5
test ruby 2/6:
<<: *test_settings
<<: *jit_matrix
only:
- master
script:
./spec.sh ruby 2.6
test ruby 2/7:
<<: *test_settings
<<: *jit_matrix
script:
./spec.sh ruby 2.7
test ruby 3/0:
<<: *test_settings
<<: *jit_matrix
script:
./spec.sh ruby 3.0
test ruby 3/1:
<<: *test_settings
<<: *yjit_matrix
script:
./spec.sh ruby 3.1
test truffleruby:
<<: *test_settings
script:
./spec.sh truffleruby latest
allow_failure: true
coverage:
coverage: '/\(\d+.\d+\%\) covered/'
stage: prepare
variables:
BUNDLE_WITHOUT: test:website:assorted
image: "ruby:3.1"
script:
- gem install simplecov --no-doc
# 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`'?' {} \;
- rake coverage:report
artifacts:
paths:
- "coverage/"
docs:
stage: deploy
needs:
- coverage
image: "ruby:3.1"
script:
- rake prepare_website
artifacts:
paths:
- rdoc/
- wiki/
- coverage/
only:
- master
prepare_release:
stage: prepare
rules:
- if: $CI_COMMIT_TAG
when: never
script:
- echo "EXTRA_DESCRIPTION=$(cat doc/release_notes/${${CI_COMMIT_TAG:1}//./_}.md)" >> variables.env
- echo "TAG=v$(cat CI_COMMIT_TAG)" >> variables.env
artifacts:
reports:
dotenv: variables.env
release:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_release
artifacts: true
rules:
- if: $CI_COMMIT_TAG
when: never
script:
- echo "running release_job for $TAG"
release:
name: 'Release $TAG'
description: '$EXTRA_DESCRIPTION'
tag_name: '$TAG'
ref: '$CI_COMMIT_SHA'