-
Notifications
You must be signed in to change notification settings - Fork 3
/
.cirrus.yaml
133 lines (101 loc) · 3.02 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
os_setup: &os_setup
container:
image: debian
os_setup_script:
- apt update && apt upgrade -y && apt install git make gcc -y
- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(rbenv init -)"' >> ~/.bashrc
- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(nodenv init -)"' >> ~/.bashrc
rbenv_cache: &rbenv_cache
rbenv_cache:
folder: $HOME/.rbenv
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
nodenv_cache: &nodenv_cache
nodenv_cache:
folder: $HOME/.nodenv
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
bundle_cache: &bundle_cache
bundle_cache:
folder: /usr/local/bundle
fingerprint_script:
- source ~/.bashrc
- echo $CIRRUS_OS
- ruby -v
- cat Gemfile.lock
install_script:
- gem install bundler
- bundle install
node_modules_cache: &node_modules_cache
node_modules_cache:
folder: node_modules
fingerprint_script:
- source ~/.bashrc
- echo $CIRRUS_OS
- node -v
- cat package.json
install_script: npm install
remark_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- npm run lint:markdown
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'package.json', 'package-lock.json', '.remarkrc.yaml', '**.md'
)
stylelint_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- npm run lint:styles
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'package.json', 'package-lock.json', 'browserslist',
'.stylelintrc.yaml', 'assets/styles/**'
)
eslint_task:
<<: *os_setup
always:
<<: *nodenv_cache
<<: *node_modules_cache
lint_script:
- source ~/.bashrc
- npm run lint:scripts
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'package.json', 'package-lock.json', 'browserslist',
'.eslintrc.yaml', '.eslintignore', 'assets/scripts/**'
)
rubocop_task:
<<: *os_setup
always:
<<: *rbenv_cache
rubocop_artifacts:
path: rubocop.json
type: text/json
format: rubocop
<<: *bundle_cache
lint_script:
- source ~/.bashrc
- bundle exec rubocop --format=json --out=rubocop.json
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', 'Gemfile.lock', '.rubocop.yml', '**.rb'
)