-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
144 lines (137 loc) · 3.39 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
144 lines (137 loc) · 3.39 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# stages of gitlab ci.
stages:
- test
- deploy
- 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
# release a preview blog for master branch with gitlab pages.
pages:
stage: deploy
before_script:
# setup rbenv.
- source ~/.bash_profile
# use ruby version 3.0.0 .
- rbenv global 3.0.0
# delete and recreate directory.
- rm --force --recursive public
- mkdir public
# go to blog folder.
- cd doc/blog
# install dependency gems.
- bundle config set path 'vendor'
- bundle install
script:
# generate site with jekyll.
- bundle exec jekyll build --trace --config ./_config.yml --destination ../../public
artifacts:
paths:
- public
expire_in: 7 days
only:
- tags
when: manual
# 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 jekyll-openmoji.gemspec
- gem push "jekyll-openmoji-$version.gem"
# only run for new tags.
only:
- tags
when: manual