Skip to content
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

Move CI to GHA #117

Merged
merged 7 commits into from
Jul 22, 2022
Merged

Move CI to GHA #117

merged 7 commits into from
Jul 22, 2022

Conversation

agrberg
Copy link
Collaborator

@agrberg agrberg commented Jul 21, 2022

resolves #116

@agrberg agrberg requested a review from dblock July 21, 2022 16:12
* Add GHA's test config
* remove TravisCI config
* Update references in documentation
@agrberg
Copy link
Collaborator Author

agrberg commented Jul 21, 2022

The error on Ruby 3.0 and 3.1 is because Rubocop changed how it works under the hood. I'm installing Ruby 3.0 now to see what's the minimum version of Rubocop needed to get the Ruby min 2.4 working on 3.0 before addressing the 2.7 update.

Ruby 3.0 removed hash and kwarg coersion. Rubocop 0.75.0 is the earliest version that corrects this.

Add Rubocop offenses to TODO yml.

See Ruby language post at https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/. I also wrote about this at https://medium.com/building-rigup/hash-and-keyword-coercion-213425f69719.
Rubocop under Ruby >= 3.1 has a problem with this file if the library is not required. My guess has to do w/ a change constant resolution.
@agrberg
Copy link
Collaborator Author

agrberg commented Jul 21, 2022

Alright! Looks like it's passing on Rubies 2.7, 3.0, and 3.1 now and can be reviewed 😌

.github/workflows/test.yml Outdated Show resolved Hide resolved
Copy link
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Below.

Make sure CI actually passes, see https://github.com/agrberg/iex-ruby-client/actions in your fork.

.github/workflows/test.yml Outdated Show resolved Hide resolved
@dblock
Copy link
Owner

dblock commented Jul 22, 2022

The error on Ruby 3.0 and 3.1 is because Rubocop changed how it works under the hood. I'm installing Ruby 3.0 now to see what's the minimum version of Rubocop needed to get the Ruby min 2.4 working on 3.0 before addressing the 2.7 update.

Adding Ruby 3.0 support can be done later, separately. Get a minimum amount of GHA to pass.

@agrberg agrberg requested a review from dblock July 22, 2022 13:36
@agrberg
Copy link
Collaborator Author

agrberg commented Jul 22, 2022

GitHub's CI is still a little new to me but if I'm reading the workflows correctly it looks like the last push to this branch yesterday passed as did the update this morning to remove the concurrency from test.yml

I can move the two commits related to Ruby 3.0 and 3.1 to another PR if you feel strongly. I wanted to point out that they're essentially behind-the-scenes trivial changes though:

  • Ruby 3.0 changed how hash and kwarg coercion worked (lang doc and my take). There was only a minor change needed from Rubocop 0.72.0 to 0.75.0 to make this work isolated in commit 7b1b566
  • The change needed for Ruby 3.1 is a bug in Rubocop's parsing that can be worked around with a simple require.

Please let me know if I'm missing something obvious 😅

Copy link
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

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

We do have a Dangerfile (PR linter), bring the GHA that runs Danger as well in.
https://github.com/slack-ruby/slack-ruby-client/blob/master/.github/workflows/danger.yml

It wouldn't be such a bad idea to split up Rubocop and tests as well, avoiding running rubocop on every test, but not a must have.

A few more things below.

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
* Remove unneeded concurrancy
* Remove RACK_ENV var
@agrberg agrberg force-pushed the move_ci_to_gha branch 2 times, most recently from 5e7925b to 297b1be Compare July 22, 2022 14:25
danger:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I copied this approach from your Slack Ruby client along with a separate Gemfile.danger. I didn't pull the common items out of the Gemfile but I think it would be valuable to do later while also moving the dev dependencies from the gemspec to the Gemfile.

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is my understanding that this will fetch all the commits as opposed to simply the last one. I'm not familiar with Danger though so I'm unsure why this is valuable. Can you illuminate?

Copy link
Owner

Choose a reason for hiding this comment

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

I forget why that was needed, but it's fetch all history for all tags and branches. I think there was some error from Danger when it didn't have access to all of it.

@agrberg agrberg requested a review from dblock July 22, 2022 14:32
@agrberg
Copy link
Collaborator Author

agrberg commented Jul 22, 2022

Thanks for the patience and tips. I believe the Danger workflow isn't kicking off because it is only done when making a PR as opposed to updating a PR. GHA's UI isn't letting me run in manually either. My assumption there is because it's new and hasn't ever been run. Kind of a catch-22 🥲

@dblock dblock merged commit add7db0 into dblock:master Jul 22, 2022
@dblock
Copy link
Owner

dblock commented Jul 22, 2022

Merged! Let's see those other PRs.

@agrberg agrberg deleted the move_ci_to_gha branch July 22, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace Travis-CI with GHA
2 participants