-
Notifications
You must be signed in to change notification settings - Fork 2
/
.cirrus.yaml
150 lines (118 loc) · 3.58 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
143
144
145
146
147
148
149
150
os_setup: &os_setup
container:
image: archlinux
os_setup_script:
- pacman -Syu --noconfirm
- pacman -S --needed --noconfirm git gcc make libyaml postgresql-libs
env:
## To suppress flood of warnings:
## https://github.com/cirruslabs/cirrus-ci-docs/issues/814
## https://github.com/rubygems/rubygems/issues/4466#issuecomment-818688569
## Global for:
## 1. different tasks (rubocop, test, etc.);
## 2. avoiding overriding `env` in specific cases like macOS.
TMPDIR: $CIRRUS_WORKING_DIR
rbenv_cache: &rbenv_cache
rbenv_setup_script:
- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(rbenv init -)"' >> ~/.bashrc
rbenv_cache:
folder: $HOME/.rbenv
fingerprint_script:
- echo $CIRRUS_OS
- cat .ruby-version
populate_script:
- git clone https://github.com/rbenv/rbenv.git ~/.rbenv
- source ~/.bashrc
## 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
- exe/setup/ruby.sh
nodenv_cache: &nodenv_cache
nodenv_setup_script:
- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(nodenv init -)"' >> ~/.bashrc
nodenv_cache:
folder: $HOME/.nodenv
fingerprint_script:
- echo $CIRRUS_OS
- cat .node-version
populate_script:
- git clone https://github.com/nodenv/nodenv.git ~/.nodenv
- source ~/.bashrc
## 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
- exe/setup/node.sh
bundle_cache: &bundle_cache
bundle_cache:
folder: /usr/local/bundle
fingerprint_script:
- echo $CIRRUS_OS
- cat .ruby-version
- cat Gemfile.lock
install_script:
- source ~/.bashrc
- exe/setup/ruby.sh
node_modules_cache: &node_modules_cache
node_modules_cache:
folder: node_modules
fingerprint_script:
- echo $CIRRUS_OS
- cat .node-version
- cat pnpm-lock.yaml
install_script:
- source ~/.bashrc
- exe/setup/node.sh
remark_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- pnpm run lint:docs
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', '.node-version', 'package.json', 'package-lock.json',
'.remarkrc.yaml', '**.md'
)
stylelint_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- pnpm run lint:styles
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', '.node-version', 'package.json', 'package-lock.json',
'browserslist', '.stylelintrc.yaml', 'assets/styles/**'
)
eslint_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- pnpm run lint:scripts
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', '.node-version', 'package.json', 'package-lock.json',
'browserslist', '.eslint*', 'assets/scripts/**', '*.js'
)
rubocop_task:
<<: *os_setup
always:
<<: *rbenv_cache
<<: *bundle_cache
lint_script:
- source ~/.bashrc
- bundle exec rubocop
only_if: ($CIRRUS_BRANCH == 'main') ||
changesInclude(
'.cirrus.yaml', '.gitignore', '.ruby-version', 'Gemfile', 'Gemfile.lock',
'.rubocop.yml', '**.rb', '**.ru'
)