Stateless Code | Set up GitHub Actions with Rails 7 and Get Working with PostgreSQL @StatelessCode | Uploaded September 2022 | Updated October 2024, 4 hours ago.
Before we start doing real development for our Rails 7 app, we want to establish the foundation of having an automated build on GitHub so that we can run a set of checks on the health of a pushed branch before merging it. This helps enhance the maintainability of our app by identifying or preventing technichal debt from being accidentally introduced into the app. This could become even more important in the future if we have other collaborators who want to contribute to the project.
We use the existing GitHub action from our NerdDice RubyGem as a starting point and then adapt it for use with Rails, PostgreSQL, and MiniTest. Getting the GitHub action working with PostgreSQL is the particular challenge and interest tackled in this video. We will deal with ensuring the browser-driven system tests work in the next video.
This video covers:
00:00:12 Introduction, recap of previous videos, and overview of how GitHub Actions were set up on the NerdDice RubyGem
00:02:51 Differences between the RubyGem and Rails projects (system tests and database setup)
00:04:32 Copy and adapt GitHub Actions file from NerdDice RubyGem
00:13:36 Initial push for GitHub Action, fix incorrect reference
00:15:55 Various unsuccessful iterations to get GitHub Action working with PostgreSQL
00:29:05 Get working solution of GitHub Action specific database.yml thanks to Jetse Koopmans from pibit
00:33:50 Run and commit migration to generate schema.rb and make build green
00:38:46 Try to get the database already exists warning cleared, but revert to previous state for the time being
#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #githubactions
See other related StatelessCode videos:
- NerdDice RubyGem: Goodbye, Travis! Hello GitHub Actions! youtu.be/XXCbkX-tBTQ
Resources that we relied upon for this solution:
- GitHub Actions with Rails, Postgres and RSpec by Jetse Koopmans https://www.pibit.nl/github/actions/rails/postgres/rspec/tutorial/example/2019/09/23/github-actions-with-rails-postgres-and-rspec/
- Rails System Tests with GitHub Actions by Eric Saupe https://eric.sau.pe/rails-system-tests-with-github-actions
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Before we start doing real development for our Rails 7 app, we want to establish the foundation of having an automated build on GitHub so that we can run a set of checks on the health of a pushed branch before merging it. This helps enhance the maintainability of our app by identifying or preventing technichal debt from being accidentally introduced into the app. This could become even more important in the future if we have other collaborators who want to contribute to the project.
We use the existing GitHub action from our NerdDice RubyGem as a starting point and then adapt it for use with Rails, PostgreSQL, and MiniTest. Getting the GitHub action working with PostgreSQL is the particular challenge and interest tackled in this video. We will deal with ensuring the browser-driven system tests work in the next video.
This video covers:
00:00:12 Introduction, recap of previous videos, and overview of how GitHub Actions were set up on the NerdDice RubyGem
00:02:51 Differences between the RubyGem and Rails projects (system tests and database setup)
00:04:32 Copy and adapt GitHub Actions file from NerdDice RubyGem
00:13:36 Initial push for GitHub Action, fix incorrect reference
00:15:55 Various unsuccessful iterations to get GitHub Action working with PostgreSQL
00:29:05 Get working solution of GitHub Action specific database.yml thanks to Jetse Koopmans from pibit
00:33:50 Run and commit migration to generate schema.rb and make build green
00:38:46 Try to get the database already exists warning cleared, but revert to previous state for the time being
#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #githubactions
See other related StatelessCode videos:
- NerdDice RubyGem: Goodbye, Travis! Hello GitHub Actions! youtu.be/XXCbkX-tBTQ
Resources that we relied upon for this solution:
- GitHub Actions with Rails, Postgres and RSpec by Jetse Koopmans https://www.pibit.nl/github/actions/rails/postgres/rspec/tutorial/example/2019/09/23/github-actions-with-rails-postgres-and-rspec/
- Rails System Tests with GitHub Actions by Eric Saupe https://eric.sau.pe/rails-system-tests-with-github-actions
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.