forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: ✂️ cut trailing whitespace Switch to headless chrome by default (rails#50512) Fix generator output paths New default files Errant debug puts Add changelog entry for rails#50505 [ci skip] (rails#50513) Default to creating GitHub CI files (rails#50508)
- Loading branch information
Showing
10 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
<%- unless skip_brakeman? -%> | ||
scan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: .ruby-version | ||
bundler-cache: true | ||
|
||
- name: Scan for security vulnerabilities | ||
run: bin/brakeman | ||
<% end -%> | ||
<%- unless skip_rubocop? -%> | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: .ruby-version | ||
bundler-cache: true | ||
|
||
- name: Lint code for consistent style | ||
run: bin/rubocop | ||
<% end -%> | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
<%- if options[:database] == "sqlite3" -%> | ||
# services: | ||
# redis: | ||
# image: redis | ||
# ports: | ||
# - 6379:6379 | ||
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | ||
<%- else -%> | ||
services: | ||
<%- if options[:database] == "mysql" || options[:database] == "trilogy" -%> | ||
mysql: | ||
image: mysql | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: true | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
<%- elsif options[:database] == "postgresql" -%> | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
<%- end -%> | ||
|
||
# redis: | ||
# image: redis | ||
# ports: | ||
# - 6379:6379 | ||
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
<%- end -%> | ||
steps: | ||
- name: Install packages | ||
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%= (dockerfile_deploy_packages + [build_package_for_database]).join(" ") %> | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: .ruby-version | ||
bundler-cache: true | ||
|
||
- name: Run Tests | ||
env: | ||
RAILS_ENV: test | ||
<%- if options[:database] == "mysql" || options[:database] == "trilogy" -%> | ||
DATABASE_URL: mysql2://127.0.0.1:3306 | ||
<%- elsif options[:database] == "postgresql" -%> | ||
DATABASE_URL: postgres://postgres:postgres@localhost:5432 | ||
<%- end -%> | ||
# REDIS_URL: redis://localhost:6379/0 | ||
run: bin/rails db:setup test test:system |
7 changes: 7 additions & 0 deletions
7
railties/lib/rails/generators/rails/app/templates/github/dependabot.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: bundler | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
2 changes: 1 addition & 1 deletion
2
railties/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require "test_helper" | ||
|
||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase | ||
driven_by :selenium, using: :chrome, screen_size: [ 1400, 1400 ] | ||
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] | ||
end |
2 changes: 1 addition & 1 deletion
2
railties/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require "test_helper" | ||
|
||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase | ||
driven_by :selenium, using: :chrome, screen_size: [1400, 1400] | ||
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] | ||
end |
2 changes: 1 addition & 1 deletion
2
railties/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require "test_helper" | ||
|
||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase | ||
driven_by :selenium, using: :chrome, screen_size: [1400, 1400] | ||
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters