-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
52 lines (50 loc) · 1.97 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include:
- project: "nstmrt/rubygems/templates"
ref: master
file: "build-rubygems.yml"
lint:
stage: test
image: ${BUILD_CONF_HARBOR_REGISTRY}/dhub/library/ruby:3.3
tags:
- paas-stage
script:
- bundle install
- bundle exec rubocop
tests:
stage: test
image: ${BUILD_CONF_HARBOR_REGISTRY}/dhub/library/ruby:$RUBY_VERSION
tags:
- paas-medium
services:
- name: ${BUILD_CONF_HARBOR_REGISTRY}/dhub/library/postgres:13
alias: postgres
variables:
POSTGRES_HOST_AUTH_METHOD: trust
DATABASE_URL: postgres://postgres:secret@postgres:5432
PACT_DO_NOT_TRACK: true
parallel:
matrix:
- RUBY_VERSION: ['2.7', '3.0', '3.1', '3.2', '3.3']
before_script:
- |
https_proxy=${INTERNAL_WEB_PROXY} curl -LO https://github.com/pact-foundation/pact-plugins/releases/download/pact-plugin-cli-v0.0.0/pact-plugin-cli-linux-x86_64.gz && \
gunzip pact-plugin-cli-linux-x86_64.gz && \
chmod +x pact-plugin-cli-linux-x86_64 && \
mv pact-plugin-cli-linux-x86_64 /usr/local/bin/pact-plugin-cli && \
https_proxy=${INTERNAL_WEB_PROXY} pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/tag/v-0.4.0
- |
https_proxy=${INTERNAL_WEB_PROXY} curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip && \
unzip protoc-21.12-linux-x86_64.zip -d protoc && \
chmod +x protoc/bin/protoc && \
mv protoc/bin/protoc /usr/local/bin/protoc
- gem sources --remove https://rubygems.org/
- gem sources --add ${RUBYGEMS_PUBLIC_SOURCE}
- gem install bundler -v 2.4.22
- bin/setup
script:
- bundle exec appraisal rspec --format RspecJunitFormatter --out test-results/rspec_$RUBY_VERSION.xml --format documentation
- bundle exec appraisal rspec -t pact spec/pact/providers/**/*_spec.rb
- bundle exec appraisal rspec -t pact spec/pact/consumers/*_spec.rb
artifacts:
reports:
junit: test-results/rspec*.xml