summaryrefslogtreecommitdiffstats
path: root/CLI/ruby/.gitlab-ci.yml
blob: d573ce54755838ba4a07fa4754405e91c417da6c (plain) (blame)
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
image: ruby:2.7
stages:
  - build
  - test
  - lint
  - release

variables:
  BUNDLE_PATH: .bundle/vendor

cache: &cache
  policy: pull-push
  key:
    files:
      - Gemfile.lock
  paths:
    - CLI/ruby/.bundle/vendor

before_script:
  - cd CLI/ruby
  - gem update --system
  - bundle update --bundler
  - bundle install -j $(nproc)

test:2.7:
  image: ruby:2.7
  stage: test
  cache:
    <<: *cache
    policy: pull
  script:
    - bundle exec rspec --format progress

test:2.6:
  image: ruby:2.6
  stage: test
  cache:
    <<: *cache
    policy: pull
  script:
    - bundle exec rspec --format progress

test:2.5:
  image: ruby:2.5
  stage: test
  cache:
    <<: *cache
    policy: pull
  script:
    - bundle exec rspec --format progress

lint:
  stage: test
  cache:
    <<: *cache
    policy: pull
  script:
    - bundle exec rubocop

release:
  stage: release
  needs: ["test:2.7", "test:2.6", "test:2.5", lint]
  rules:
    - if: $CI_COMMIT_TAG =~ /^ruby\/v.*$/
  cache:
    <<: *cache
    policy: pull
  script:
    - bundle exec rake clean
    - bundle exec rake clobber
    - bundle exec rake build
    - bundle exec gem push pkg/terminal_game_of_life-*.gem