-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
116 lines (110 loc) · 2.75 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# stages of gitlab ci.
stages:
- test
- release
# default settings for all ci jobs.
default:
image: azadehafzarhub/gitlab-ci-ruby-build:latest
cache:
paths:
- vendor/
# job for testing package against default ruby version
# on master branch and send test coverage result to
# codeclimate.
test master branch defaut:
stage: test
before_script:
# setup rbenv.
- source ~/.bash_profile
# use default ruby version.
- rbenv global 3.0.0
# install dependency gems.
- bundle config set path 'vendor'
- bundle install
# run codeclimate test reporter agent.
- cc-test-reporter before-build
# run tests.
script:
- cd script && ./test.sh
# send test coverage result to codeclimate.
after_script:
- cc-test-reporter after-build --coverage-input-type simplecov
only:
- master
# job for testing package on mon master branch
# and merge requests against other ruby versions.
test master branch ruby 2.7.2:
stage: test
before_script:
# setup rbenv.
- source ~/.bash_profile
# use custom ruby version.
- rbenv global 2.7.2
# install dependency gems.
- bundle config set path 'vendor'
- bundle install
# run tests.
script:
- cd script && ./test.sh
only:
- master
# job for testing package on other branches than master
# and merge requests against default version.
test branch ruby default:
stage: test
before_script:
# setup rbenv.
- source ~/.bash_profile
# use default ruby version.
- rbenv global 3.0.0
# install dependency gems.
- bundle config set path 'vendor'
- bundle install
# run tests.
script:
- cd script && ./test.sh
only:
- branches
- merge_requests
except:
- master
# job for testing package on other branches than master
# and merge requests against other ruby versions.
test branch ruby 2.7.2:
stage: test
before_script:
# setup rbenv.
- source ~/.bash_profile
# use custom ruby version.
- rbenv global 2.7.2
# install dependency gems.
- bundle config set path 'vendor'
- bundle install
# run tests.
script:
- cd script && ./test.sh
only:
- branches
- merge_requests
except:
- master
# deploy gems to rubygems.org whenever a tag is released.
release to rubygems:
stage: release
script:
# setup rbenv.
- source ~/.bash_profile
# use default ruby version.
- rbenv global 3.0.0
# create rubygems credential file for auto login.
- script/ci_rubygems.sh
# extract tag from git log and strip "v".
- version=$(git describe --tags)
- version=${version:1}
# build and push gem.
- gem build html-pipeline-negarmoji.gemspec
- gem push "html-pipeline-negarmoji-$version.gem"
# only run for new tags.
only:
- tags
when: manual