Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ransack_demo_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/ransack_demo_test

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.3'
bundler-cache: true

- name: Setup Database
run: |
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed

- name: Run Tests
run: |
bundle exec rails test

- name: Run RuboCop
run: |
bundle exec rubocop --format github

system-test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ransack_demo_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/ransack_demo_test

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.3'
bundler-cache: true

- name: Setup Database
run: |
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed

- name: Install Chrome dependencies
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable

- name: Run System Tests
run: |
bundle exec rails test:system
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bundle
vendor/bundle
db/*.sqlite3
log/*.log
tmp/
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.4
3.2.3
21 changes: 14 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ source "https://rubygems.org"

ruby file: ".ruby-version"

gem "rails", "~> 7.1.0"
gem "rails", "~> 8.0.0"

# Use PostgreSQL as the database for Active Record
gem "pg", "~> 1.0"
# Use Puma as the app server
gem "puma", "~> 5.6"
gem "puma", "~> 6.0"
# Use Tailwind CSS for styling
gem "tailwindcss-rails", "~> 2.0"
# Use Importmap for managing JavaScript dependencies
gem "importmap-rails", "~> 2.0"
# Turbo provides partial page replacement and forms without full page reloads
gem "turbo-rails", "~> 2.0"
# Stimulus provides reactive behavior for JavaScript
gem "stimulus-rails", "~> 1.0"
# Use SCSS for stylesheets
gem "sass-rails", "~> 5.0"
# Use Uglifier as compressor for JavaScript assets
gem "uglifier", ">= 1.3.0"
gem "sass-rails", "~> 6.0"
# Use jquery as the JavaScript library
gem "jquery-rails"
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
# gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use ActiveModel has_secure_password
Expand All @@ -27,6 +31,9 @@ gem "faker"
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "byebug", platform: :mri
# System testing gems
gem "selenium-webdriver"
gem "webdrivers"
end

group :development do
Expand Down
Loading
Loading