-
Notifications
You must be signed in to change notification settings - Fork 19
/
config.yml
113 lines (108 loc) · 3 KB
/
config.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
version: 2.1
orbs:
pushover: masutaka/pushover@2
executors:
default:
parameters:
ruby_version:
type: enum
enum: ['3.0', '3.1', '3.2', '3.3']
docker:
- image: cimg/ruby:<< parameters.ruby_version >>
working_directory: ~/repo
commands:
setup_requirements:
steps:
- run:
name: Set timezone to Asia/Tokyo
command: sudo cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
restore_bundle_cache:
parameters:
ruby_version:
type: enum
enum: ['3.0', '3.1', '3.2', '3.3']
steps:
- restore_cache:
name: Restore bundle cache
keys:
- gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }}
- gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-
save_bundle_cache:
parameters:
ruby_version:
type: enum
enum: ['3.0', '3.1', '3.2', '3.3']
steps:
- save_cache:
name: Save bundle cache
key: gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }}
paths:
- ~/repo/vendor/bundle
jobs:
build:
parameters:
ruby_version:
type: enum
enum: ['3.0', '3.1', '3.2', '3.3']
executor:
name: default
ruby_version: << parameters.ruby_version >>
steps:
- setup_requirements
- checkout
- restore_bundle_cache:
ruby_version: << parameters.ruby_version >>
- run:
name: bundle install
command: |
bundle config set --local path vendor/bundle
bundle check || bundle install --jobs=4 --retry=3
bundle clean
- save_bundle_cache:
ruby_version: << parameters.ruby_version >>
- run: bundle exec rubocop
- run: bundle exec rspec
- pushover/notify-on-failure
continuous_bundle_update:
executor:
name: default
ruby_version: '3.3'
steps:
- setup_requirements
- checkout
- restore_bundle_cache:
ruby_version: '3.3'
- run:
name: Install edge circleci-bundle-update-pr
command: |
gem install -N specific_install
gem specific_install https://github.com/masutaka/circleci-bundle-update-pr.git
- deploy:
name: Run circleci-bundle-update-pr
command: circleci-bundle-update-pr CircleCI [email protected] $CIRCLE_BRANCH -d
- pushover/notify-on-failure
workflows:
version: 2
ordinary:
jobs:
- build:
name: ruby-3.0
ruby_version: '3.0'
- build:
name: ruby-3.1
ruby_version: '3.1'
- build:
name: ruby-3.2
ruby_version: '3.2'
- build:
name: ruby-3.3
ruby_version: '3.3'
nightly:
triggers:
- schedule:
cron: "00 10 1 * *"
filters:
branches:
only: main
jobs:
- continuous_bundle_update