calebhearth / formulaic

Simplify form filling with Capybara
MIT License
552 stars 29 forks source link

Github workflow for a gem #80

Open notapatch opened 1 year ago

notapatch commented 1 year ago

https://github.com/calebhearth/formulaic/issues/77

calebhearth commented 1 year ago

Hey, sorry for the delay. https://github.com/ManageIQ/vmware_web_service/actions/runs/1775391270/workflow looks like an example of using a Ruby + Rails matrix. I'll enable GitHub Actions now.

notapatch commented 1 year ago

RE: delay - no worries, with open source, patience is a virtue. I'm on UK time BTW.

TEST_RAILS_VERSION

I'm trying to understand where Rails version comes into it?

The CI doesn't install Rails (see image below). Is the idea that the environment TEST_RAILS_VERSION is used somewhere in the code? I looked for the environment in your Gem, Capybara, and active_support (I won't pretend I know what I'm doing in regards to Rails but I thought I should at least try).

Within active_support I found a method test_rails_version maybe that's where it comes in?

formulaic-bundle-install

Ubuntu and Mac OS

The code in the PR varied the test run over Ubuntu and Mac OS I thought that might be useful because I run Capybara locally, on. a Macbook, and in a CI. I'm assuming you don't want this?

calebhearth commented 1 year ago

Ah sorry I saw just the matrix and thought this was being handled by GitHub.

https://github.com/ManageIQ/vmware_web_service/blob/b47471f9be1eed421cfd1613e321dea71755a60b/Gemfile switches on an ENV variable for the ActiveSupport version (we'll use Rails) defined in Gemfile. Gemfile isn't used in published gems, so that gives us a place to store the versions without impacting users.

https://github.com/ruby/setup-ruby#matrix-of-gemfiles is another option. You can see that they use the gemfile matrix variable to find a gemfile then set BUNDLE_GEMFILE with that, which will tell bundler to look at different files per run.

Ubuntu and Mac OS

I have no problem with it, but if we're limited to 2 dimensional matrices or if it's going to blow up the number of runs, I'd say we leave it out. I don't think it is going to provide a huge amount of value as Ruby is interpreted, not compiled, so we'd only be looking at differences between compiled dependencies, which should be handling their own compatibility in their testing.

notapatch commented 1 year ago

:wave: Hello Caleb

Requirements

Matrix that iterates over: 1) ruby: 2.7, 3.0, 3.1, head 2) ENV TEST_RAILS_VERSION: '6.0', '6.1', '7.0' (although you can solve it also by using BUNDLE_GEMFILE)


RE: TEST_RAILS_VERSION: I must admit, I'm not sure how TEST_RAILS_VERSION is used unless we call VMWare during the CI run?? But my confusion isn't that important as long as I know what you require, ☝️, since, unlike me, you know what you're talking about.

RE: Ubuntu and Mac OS: I'll drop that part of the code. We will use ubuntu_latest

You don't want anything else in the steps other than rspec running?