Skip to content

Commit 3eba13c

Browse files
committed
Upgrade rails to 8.0
1 parent 8dc647a commit 3eba13c

File tree

39 files changed

+1114
-606
lines changed

39 files changed

+1114
-606
lines changed

.dockerignore

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
# Ignore git directory.
44
/.git/
5+
/.gitignore
6+
7+
# Ignore CI service files.
8+
/.github
59

610
# Ignore bundler config.
711
/.bundle
812

9-
# Ignore environment variables.
10-
/.env
13+
# Ignore all environment files.
14+
/.env*
1115

1216
# Ignore all default key files.
1317
/config/master.key
@@ -36,3 +40,11 @@
3640
/app/assets/builds/*
3741
!/app/assets/builds/.keep
3842
/public/assets
43+
44+
# Ignore Kamal files.
45+
/config/deploy*.yml
46+
/.kamal
47+
48+
# Ignore Docker-related files.
49+
/.dockerignore
50+
/Dockerfile*

.github/workflows/ci.yml

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,54 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
scan_ruby:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
bundler-cache: true
22+
23+
- name: Run brakeman
24+
run: bin/brakeman --no-pager
25+
26+
scan_js:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 10
29+
30+
steps:
31+
- name: Check out code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Ruby
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
bundler-cache: true
38+
39+
- name: Run importmap audit
40+
run: bin/importmap audit
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
timeout-minutes: 10
45+
46+
steps:
47+
- name: Check out code
48+
uses: actions/checkout@v4
49+
50+
- name: Set up Ruby
51+
uses: ruby/setup-ruby@v1
52+
with:
53+
bundler-cache: true
54+
55+
- name: Run rubocop
56+
run: bin/rubocop -f github
57+
1058
test:
1159
name: Test
1260

@@ -15,22 +63,27 @@ jobs:
1563

1664
steps:
1765
- name: Check out code
18-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
1967

2068
- name: Set up Ruby
2169
uses: ruby/setup-ruby@v1
2270
with:
2371
bundler-cache: true
2472

25-
- name: Run rubocop
26-
run: bundle exec rubocop --parallel
27-
2873
- name: Set up database
29-
run: bundle exec rails db:setup
74+
run: bin/rails db:test:prepare
3075
env:
3176
RAILS_ENV: test
3277

3378
- name: Run tests
34-
run: bundle exec rails test:all
79+
run: bin/rails test test:system
3580
env:
3681
RAILS_ENV: test
82+
83+
- name: Keep screenshots from failed system tests
84+
uses: actions/upload-artifact@v4
85+
if: failure()
86+
with:
87+
name: screenshots
88+
path: ${{ github.workspace }}/tmp/screenshots
89+
if-no-files-found: ignore

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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

10-
# Ignore environment variables.
11-
/.env
10+
# Ignore all environment files.
11+
/.env*
1212

1313
# Ignore all default key files.
1414
/config/master.key

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-3.2.2
1+
ruby-3.4.1

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# syntax = docker/dockerfile:1
1+
# syntax=docker/dockerfile:1
2+
# check=error=true
23

34
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4-
ARG RUBY_VERSION=3.2.2
5-
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
5+
ARG RUBY_VERSION=3.4.1
6+
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
67

78
# Rails app lives here
89
WORKDIR /rails
@@ -15,7 +16,7 @@ ENV RAILS_ENV="production" \
1516

1617

1718
# Throw-away build stage to reduce size of final image
18-
FROM base as build
19+
FROM base AS build
1920

2021
# Install packages needed to build gems
2122
RUN apt-get update -qq && \

Gemfile

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
source 'https://rubygems.org'
44

5-
ruby '3.2.2'
5+
ruby '3.4.1'
66

77
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
8-
gem 'rails', '~> 7.1.0'
8+
gem 'rails', '~> 8.0.0'
99

10-
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
11-
gem 'sprockets-rails'
10+
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
11+
gem 'propshaft'
1212

1313
# Use sqlite3 as the database for Active Record
1414
gem 'sqlite3'
@@ -25,15 +25,15 @@ gem 'turbo-rails'
2525
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
2626
gem 'stimulus-rails'
2727

28+
# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
29+
gem 'tailwindcss-rails'
30+
2831
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
2932
gem 'jbuilder'
3033

3134
# Use Redis adapter to run Action Cable in production
3235
gem 'redis'
3336

34-
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
35-
# gem 'kredis'
36-
3737
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
3838
# gem 'bcrypt'
3939

@@ -43,12 +43,6 @@ gem 'tzinfo-data', platforms: %i[windows jruby]
4343
# Reduces boot times through caching; required in config/boot.rb
4444
gem 'bootsnap', require: false
4545

46-
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
47-
# gem 'image_processing'
48-
49-
# Tailwind CSS for style
50-
gem 'tailwindcss-rails'
51-
5246
# Custom domain validation
5347
gem 'public_suffix'
5448

@@ -59,6 +53,9 @@ group :development, :test do
5953
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
6054
gem 'debug', platforms: %i[mri windows]
6155

56+
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
57+
gem 'brakeman', require: false
58+
6259
# Environment variables
6360
gem 'dotenv-rails'
6461
end
@@ -67,12 +64,6 @@ group :development do
6764
# Use console on exceptions pages [https://github.com/rails/web-console]
6865
gem 'web-console'
6966

70-
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
71-
# gem 'rack-mini-profiler'
72-
73-
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
74-
# gem 'spring'
75-
7667
# Linters
7768
gem 'rubocop', require: false
7869
gem 'rubocop-capybara', require: false

0 commit comments

Comments
 (0)