stages: - test - release # default settings for all ci jobs. default: image: ruby:latest cache: paths: - vendor/ # job for testing package on master branch # and send test coverage result to codeclimate. test_master: stage: test before_script: # upgrade bundler to latest version. - gem install bundler # install dependency gems. - bundle install --path vendor # setup ci environment. - script/ci_setup.sh # run code climate test reporter agent. - cc-test-reporter before-build # run tests. script: - 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 other branches # and merge requests. test_branches: stage: test # run tests. script: - script/test.sh # run on branches and merge requests. only: - branches - merge_requests # don't run on master branch. except: - master # deploy gems to rubygems.org whenever a tag is released. release_rubygems: stage: release script: # 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