-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (44 loc) · 1.3 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
53
image: "${ruby}"
cache:
key: "${CI_COMMIT_REF_SLUG}-${ruby}"
paths: [ "vendor/ruby", "gemfiles/vendor/ruby" ]
before_script:
- ruby -v
- bundle config set path "vendor/ruby"
- bundle install --jobs $(nproc)
.test:
stage: test
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "web"'
# Rubocop ######################################################################
rubocop:
extends: .test
variables: { ruby: "ruby:3.2" }
script: bundle exec rubocop
# RSpec ########################################################################
rspec:
extends: .test
services: [ "${redis}" ]
variables: { REDIS_URL: "redis://redis:6379" }
script: |
scripts/update-gemfiles
scripts/run-rspec
parallel:
matrix:
- redis: [ "redis:6.0", "redis:6.2", "redis:7.0", "redis:7.2" ]
ruby: [ "ruby:3.0", "ruby:3.1", "ruby:3.2" ]
# YARD #########################################################################
pages:
stage: deploy
variables: { ruby: "ruby:3.2" }
artifacts: { paths: [public] }
before_script:
- bundle config set with "doc"
- bundle install --jobs $(nproc)
script:
- bundle exec yard
- mv doc public
rules:
- if: '$CI_COMMIT_BRANCH == "main"'