-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yaml
142 lines (111 loc) · 4.19 KB
/
.cirrus.yaml
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
bundle_cache: &bundle_cache
bundle_cache:
folder: /usr/local/bundle
fingerprint_script:
- echo $CIRRUS_OS
- ruby -v
- cat Gemfile
install_script:
- gem update --system --no-document
- bundle update
env:
## Resolve warnings from `perl` on `rbenv` operations:
## https://cirrus-ci.com/task/6231955151781888?logs=test#L171
LANG: C.UTF-8
## Resolve warnings from Bundler in CI:
## https://github.com/cirruslabs/cirrus-ci-docs/issues/814
## https://github.com/rubygems/rubygems/issues/4466#issuecomment-818688569
## https://cirrus-ci.com/task/6231955151781888?logs=test#L198
TMPDIR: $CIRRUS_WORKING_DIR
remark_task:
container:
image: node
node_modules_cache:
folder: node_modules
fingerprint_script:
- echo $CIRRUS_OS
- node -v
- cat package.json
install_script: npm install
lint_script: npm run remark
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'package.json', '.remarkrc.yaml', '**.md'
)
bundle-audit_task:
container:
image: ruby
<<: *bundle_cache
audit_script: bundle exec bundle-audit check --update
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile'
)
rubocop_task:
container:
image: ruby
<<: *bundle_cache
lint_script: bundle exec rubocop
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', '.rubocop.yml', '**.rb', '**.ru'
)
rspec_task:
container:
image: ruby
os_setup_script:
## https://cirrus-ci.com/task/6357513148825600
## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L535
- apt-get update && apt-get upgrade -y && apt-get install git make gcc -y
## Modify `.bashrc` here because it doesn't run on cache hit:
## https://cirrus-ci.com/task/6153771409473536?command=test#L42
## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L543
- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
## https://cirrus-ci.com/task/5656294977699840?command=os_setup#L633
- echo 'eval "$(rbenv init -)"' >> ~/.bashrc
## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L543
- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
## https://cirrus-ci.com/task/5656294977699840?command=os_setup#L633
- echo 'eval "$(nodenv init -)"' >> ~/.bashrc
## Suppress git hints
- git config --global init.defaultBranch main
- git config --global pull.rebase true
always:
rbenv_cache:
folder: $HOME/.rbenv
populate_script:
- source ~/.bashrc
- git clone https://github.com/rbenv/rbenv.git ~/.rbenv
## https://github.com/rbenv/ruby-build#installation
- mkdir -p "$(rbenv root)"/plugins
- git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
nodenv_cache:
folder: $HOME/.nodenv
populate_script:
- source ~/.bashrc
- git clone https://github.com/nodenv/nodenv.git ~/.nodenv
## https://github.com/nodenv/node-build#installation
- mkdir -p "$(nodenv root)"/plugins
- git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
<<: *bundle_cache
apt_cache:
folder: /var/cache/apt/archives
reupload_on_changes: true
env:
CC_TEST_REPORTER_ID: ENCRYPTED[edf8d24c2fb80d594b3cca7eeeb06ff424221a2c6d70d7835cc4368d0b841b3ee1df692b7cd00a21b0322739be758c03]
test_script:
- source ~/.bashrc
- bundle exec rspec
cc_test_reporter_cache:
folder: cc_test_reporter
fingerprint_script:
- curl -L --no-progress-meter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
populate_script:
- mkdir -p cc_test_reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -o cc_test_reporter/test-reporter-latest
- chmod +x cc_test_reporter/test-reporter-latest
cc_test_report_script: cc_test_reporter/test-reporter-latest after-build
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', '.rspec', 'template/**', 'spec/**'
)