-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (64 loc) · 1.86 KB
/
lint-and-test.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
name: Lints and tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-20.04
services:
redis:
image: redis:3.2.12-alpine
ports:
- 6379:6379
postgres:
image: mpugach/postgres_ua:9.5
ports:
- 5432:5432
env:
POSTGRES_DB: va_db_tst
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
steps:
- name: Get repo
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '10.17.0'
- name: Cache Node packages
uses: actions/cache@v2
with:
path: |
node_modules
client/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install JS dependencies
run: npm install && npm prune && cd client && npm install && npm prune && cd ..
- name: Run ESLint
working-directory: client
run: npm run eslint
- name: Run JSCS
working-directory: client
run: npm run jscs
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.4.9'
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop --parallel
- name: Run ruby-lint
run: bundle exec ruby-lint app config spec lib
# - name: Run haml-lint
# run: bundle exec haml-lint app/views
- name: Run rspec
env:
RAILS_ENV: test
run: |
cp config/database.yml.github config/database.yml
bundle exec rake db:structure:load
cd client
npm run build:client
npm run build:server
cd ..
bundle exec rspec