forked from openstreetmap/openstreetmap-website
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (174 loc) · 5.47 KB
/
Copy pathlint.yml
File metadata and controls
174 lines (174 loc) · 5.47 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Lint
on:
push:
branches-ignore:
- "dependabot/**"
- translatewiki
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
ruby: '3.2'
jobs:
rubocop:
name: RuboCop
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
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-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Run erblint
run: bundle exec erb_lint .
herb:
name: Herb
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Run herb parser
run: bundle exec herb analyze app/
- name: Cache node modules
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: yarn
- 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 herb linter
run: bundle exec bin/yarn run herb-lint
eslint:
name: ESLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Cache node modules
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: yarn
- 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-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
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-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Configure rails
run: |
cp config/github.database.yml config/database.yml
cp config/example.storage.yml config/storage.yml
- name: Cache node modules
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: yarn
- name: Install node modules
run: bundle exec bin/yarn install
- name: Setup database
run: |
sudo systemctl start postgresql
sudo -u postgres createuser -s $(id -un)
createdb openstreetmap
bundle exec rails db:schema:load
- name: Run Annotate Models
run: bundle exec annotaterb models
- name: Fail if model annotations are out of date
run: git diff --exit-code
database_consistency:
env:
RAILS_ENV: test
name: Database Consistency
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Configure rails
run: |
cp config/github.database.yml config/database.yml
cp config/example.storage.yml config/storage.yml
- name: Cache node modules
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: yarn
- name: Install node modules
run: bundle exec bin/yarn install
- name: Setup database
run: |
sudo systemctl start postgresql
sudo -u postgres createuser -s $(id -un)
createdb openstreetmap
bundle exec rails db:schema:load
- name: Run Database Consistency
run: bundle exec database_consistency