-
Notifications
You must be signed in to change notification settings - Fork 21
110 lines (83 loc) · 2.48 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
104
105
106
107
108
109
110
name: Lint
on:
push:
branches:
- '**'
- '!main'
jobs:
backend-lint:
name: Run backend linting checks
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-node: true
- name: Run Rubocop
run: bundle exec rubocop
- name: Run Slim-Lint with PR annotations
run: bundle exec slim-lint -r github app/views app/components
- name: Run Brakeman
run: bundle exec brakeman
frontend-lint:
name: Run frontend JS and SASS linting checks
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-ruby: true
- name: Run SASS lint
run: yarn run sass:lint && yarn run js:lint
terraform-lint:
name: Run Terraform check
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Terraform pin version
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 0.15.5
- name: Terraform fmt check
run: |
set -eux
terraform fmt -check -recursive terraform
db-lint:
name: Run Database consistency checks
runs-on: ubuntu-20.04
env:
DATABASE_URL: postgis://postgres:postgres@localhost:5432/tvs_test
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
services:
postgres:
image: postgis/postgis:14-3.4-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare application environment
uses: ./.github/actions/prepare-app-env
with:
skip-node: true
- name: Set up test database
run: bin/rails db:create db:schema:load
- name: Run Database Consistency check
run: bundle exec database_consistency
- name: Upload error file
if: failure()
uses: actions/upload-artifact@v4
with:
name: database_consistency_errors
path: database_consistency_*
retention-days: 5