This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.yml
100 lines (82 loc) · 2.63 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
version: 2
jobs:
test:
working_directory: ~/app
docker:
- image: platanus/compose:1.22.0
steps:
- checkout
- setup_remote_docker
- run: docker info
- run: docker-compose -f docker-compose.ci.yml pull
- run: docker-compose -f docker-compose.ci.yml build test
- run: bin/cibuild services
- run: bin/cibuild deps
- run: bin/cibuild db
- run: bin/cibuild tests
lint:
docker:
- image: circleci/ruby:2.7-node
environment:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
steps:
- checkout
- restore_cache:
keys:
- bundle-dependencies-{{ checksum "Gemfile.lock" }}
- bundle-dependencies-
- restore_cache:
keys:
- yarn-dependencies-{{ checksum "yarn.lock" }}
- yarn-dependencies-
- run:
name: Install bundle dependencies
command: |
BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
gem install bundler:$BUNDLER_VERSION
bundle _$(echo $BUNDLER_VERSION)_ install
- save_cache:
key: bundle-dependencies-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Install yarn dependencies
command: yarn install --frozen-lockfile
- save_cache:
key: yarn-dependencies-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: Install reviewdog
command: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
- run:
name: Get files to lint
command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
- run:
name: Run rubocop
shell: /bin/bash
command: |
cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
| ./bin/reviewdog -reporter=github-pr-review -f=rubocop
- run:
name: Run eslint
shell: /bin/bash
command: |
cat tmp/files_to_lint | grep -E '.+\.(js|jsx|vue)$' | xargs yarn run eslint \
| ./bin/reviewdog -reporter=github-pr-review -f=eslint
- run:
name: Run stylelint
shell: /bin/bash
command: |
cat tmp/files_to_lint | grep -E '.+\.(scss|css|less)$' | xargs yarn run stylelint \
| ./bin/reviewdog -reporter=github-pr-review -f=stylelint
workflows:
version: 2
test_and_lint:
jobs:
- test
- lint:
context: org-global