-
Notifications
You must be signed in to change notification settings - Fork 919
103 lines (103 loc) · 2.66 KB
/
lint.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
101
102
103
name: Lint
on:
- push
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
os: ubuntu-22.04
ruby: '3.1'
jobs:
rubocop:
name: RuboCop
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop --format fuubar
erblint:
name: ERB Lint
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Run erblint
run: bundle exec erblint .
eslint:
name: ESLint
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: yarn-${{ env.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-${{ env.os }}-
- name: Install node modules
run: bundle exec bin/yarn install
- name: Create dummy database configuration
run: cp config/example.database.yml config/database.yml
- name: Run eslint
run: bundle exec rails eslint
brakeman:
name: Brakeman
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Run brakeman
run: bundle exec brakeman -q
annotate_models:
env:
RAILS_ENV: test
name: Rails Annotate Models
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Setup database
run: |
sudo systemctl start postgresql
sudo -u postgres createuser -s $(id -un)
createdb openstreetmap
cp config/github.database.yml config/database.yml
bundle exec rails db:schema:load
- name: Run Annotate Models
run: bundle exec rails annotate_models
- name: Fail if model annotations are out of date
run: git diff --exit-code