Skip to content

Default to creating GitHub CI files #50508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 31, 2023
Merged

Default to creating GitHub CI files #50508

merged 8 commits into from
Dec 31, 2023

Conversation

dhh
Copy link
Member

@dhh dhh commented Dec 31, 2023

Now that we have rubocop and brakeman by default, it makes sense to add a default GitHub CI workflow file for new applications. This will get especially newcomers off to a good start with automated scanning, linting, and testing. That's a natural continuation for the modern age of what we've done since the start with unit tests.

So we'll add .github/workflows/ci.yml and .github/dependabot.yml with good defaults.

This can be avoided with --skip-ci.

  • Setup database service if the application is setup for MySQL or PostgreSQL

@rails-bot rails-bot bot added the railties label Dec 31, 2023
@andyw8
Copy link
Contributor

andyw8 commented Dec 31, 2023

A while ago I published a re-usable GitHub Action, setup-rails. It may give some ideas for other things to add:

https://github.com/setup-rails/setup-rails/blob/main/.github/workflows/verify.yml

@dhh
Copy link
Member Author

dhh commented Dec 31, 2023

Last thing it would be nice to square here is updating the database service when you do rails db:system:change. We do that with the Dockerfile. Open if anyone wants to have a go!

@dhh dhh added this to the 8.0.0 milestone Dec 31, 2023
@dhh dhh merged commit 08a792b into main Dec 31, 2023
@dhh dhh deleted the add-cifiles branch December 31, 2023 23:37
dhh added a commit to faqndo97/rails that referenced this pull request Jan 1, 2024
* 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)
dhh added a commit to koic/rails that referenced this pull request Jan 1, 2024
* main:
  Add brakeman as development dependency
  Fix skipped rubocop test typo (rails#50519)
  Update the puma startup message
  docs: remove unneeded whitespace from start of code blocks
  Add changelog entry for rails#50512
  Add step to keep screenshots of failed system tests
  Fix name casing
  ✂️ 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)
  Remove unnecessary require
  Fix railspect not validating alphabetical order
DATABASE_URL: postgres://postgres:postgres@localhost:5432
<%- end -%>
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:setup test test:system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't test:all equivalent to test test:system?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might run system tests first. And splitting them out makes it clearer what to do if you want to parallelize tests by running system tests in their own job.

stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 22, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508

---

**To Do**

 - [ ] Consider returning early and raising if the application is not
   using PostgreSQL.
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508

---

**To Do**

 - [ ] Consider returning early and raising if the application is not
   using PostgreSQL.
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508

---

**To Do**

 - [ ] Consider returning early and raising if the application is not
   using PostgreSQL.
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508

---

**To Do**

 - [ ] Consider returning early and raising if the application is not
   using PostgreSQL.
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Also create a [Dependabot][dependabot] file based off the [the upcoming
release][ci template].

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
[dependabot]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Also create a [Dependabot][dependabot] file based off the [the upcoming
release][ci template].

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
[dependabot]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request Mar 23, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Also create a [Dependabot][dependabot] file based off the [the upcoming
release][ci template].

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
[dependabot]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot
stevepolitodesign added a commit to thoughtbot/suspenders that referenced this pull request May 10, 2024
Creates CI template to be run via [GitHub Actions][ga] based on a
[similar template][ci template] that will be generated in an upcoming
Release of Rails.

Also create a [Dependabot][dependabot] file based off the [the upcoming
release][ci template].

Raises if the application is not using PostgreSQL, since our CI template
assumes that adapter.

Because this generator can be run in an existing application, we add
conditional checks for some jobs. However, this generator is intended
to be run as part of our holistic `suspenders:install:web` which will be
introduced in #1152.

Once Rails is released to contain a CI template, we will need to
consider how we want to handle conflicts between its file and ours, but
for now, we do not need to worry about that.

[ga]: https://docs.github.com/en/actions
[ci template]: rails/rails#50508
[dependabot]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot
@rafaelfranca rafaelfranca modified the milestones: 8.0.0, 7.2.0 May 24, 2024
yoones pushed a commit to yoones/rails that referenced this pull request Mar 6, 2025
* Default to creating GitHub CI files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants