Skip to content

Commit 16bd5fd

Browse files
authored
Merge pull request #142 from SINDAN/feature/rails-7.2.2.1
Update Rails 7.2
2 parents 9a620e5 + 6f561ef commit 16bd5fd

37 files changed

+780
-567
lines changed

.env.example

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Usage .env
2+
# SAMPLE_VAR=XXXXXX
3+
#
4+
5+
# DB
6+
STATUS_MONITORING_DATABASE_USERNAME_DEV=root
7+
STATUS_MONITORING_DATABASE_PASSWORD_DEV=
8+
STATUS_MONITORING_DATABASE_USERNAME=sindan
9+
STATUS_MONITORING_DATABASE_PASSWORD=
10+
#STATUS_MONITORING_DATABASE_HOSTNAME=
11+
12+
#MYSQL_SOCKET=/var/lib/mysql/mysql.sock
13+
#REDIS_URL=
14+
15+
## for production env
16+
# Secret
17+
#SECRET_KEY_BASE=
18+
19+
# environments
20+
RAILS_LOG_LEVEL=debug

.github/workflows/ci.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ master, develop ]
7+
8+
jobs:
9+
scan_ruby:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: .ruby-version
20+
bundler-cache: true
21+
22+
- name: Scan for common Rails security vulnerabilities using static analysis
23+
run: bin/brakeman --no-pager
24+
25+
lint:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: .ruby-version
35+
bundler-cache: true
36+
37+
- name: Lint code for consistent style
38+
run: bin/rubocop -f github
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
43+
services:
44+
mysql:
45+
image: mysql
46+
env:
47+
MYSQL_ROOT_PASSWORD:
48+
MYSQL_ROOT_HOST: '%'
49+
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
50+
ports:
51+
- 3306:3306
52+
options: --health-cmd "mysqladmin ping -h 127.0.0.1" --health-interval 20s --health-timeout 10s --health-retries 10
53+
redis:
54+
image: redis
55+
ports:
56+
- 6379:6379
57+
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
62+
- name: Set up Ruby
63+
uses: ruby/setup-ruby@v1
64+
with:
65+
ruby-version: .ruby-version
66+
bundler-cache: true
67+
68+
- name: Set up Node.js
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version-file: .node-version
72+
- name: Install dependencies for npm
73+
run: yarn install
74+
75+
- name: Run tests
76+
env:
77+
RAILS_ENV: test
78+
REDIS_URL: redis://localhost:6379/0
79+
SINDAN_DATABASE_USERNAME_DEV: root
80+
SINDAN_DATABASE_PASSWORD_DEV:
81+
SINDAN_DATABASE_HOSTNAME: 127.0.0.1
82+
MYSQL_SOCKET:
83+
run: bin/rails db:test:prepare spec
84+

.gitignore

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
22
#
3-
# If you find yourself ignoring temporary files generated by your text editor
4-
# or operating system, you probably want to add a global ignore instead:
5-
# git config --global core.excludesfile '~/.gitignore_global'
3+
# Temporary files generated by your text editor or operating system
4+
# belong in git's global ignore instead:
5+
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
66

77
# Ignore bundler config.
88
/.bundle
99
vendor/bundle
1010

11-
# config
12-
config/database.yml
13-
1411
# Ignore all environment files (except templates).
1512
/.env*
1613
!/.env*.erb
14+
!/.env.example
1715

1816
# Ignore all logfiles and tempfiles.
1917
/log/*

.rubocop.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Omakase Ruby styling for Rails
2+
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3+
4+
# Overwrite or add rules to create your own house style
5+
#
6+
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7+
# Layout/SpaceInsideArrayLiteralBrackets:
8+
# Enabled: false

Gemfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
source "https://rubygems.org"
22

3-
gem "rails", "7.1.5"
3+
gem "rails", "7.2.2.1"
44

55
gem "mysql2"
66

77
gem "puma", ">= 5.0"
88

99
gem "devise"
1010

11+
gem "dotenv-rails"
12+
1113
gem "sprockets-rails"
1214
gem "jsbundling-rails"
1315

@@ -39,7 +41,13 @@ gem "bootsnap", require: false
3941

4042
group :development, :test do
4143
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
42-
gem "debug", platforms: %i[ mri windows ]
44+
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
45+
46+
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
47+
gem "brakeman", require: false
48+
49+
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
50+
gem "rubocop-rails-omakase", require: false
4351
end
4452

4553
# Use Capistrano for deployment

0 commit comments

Comments
 (0)