X Tutup
The Wayback Machine - https://web.archive.org/web/20210118045114/https://github.com/github/government.github.com/pull/851
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

feat: Update workflows to use gem caching and latest Ruby 2.7. #851

Merged
merged 7 commits into from Nov 19, 2020

Conversation

@elstudio
Copy link
Collaborator

@elstudio elstudio commented Nov 19, 2020

Update workflows to use gem caching, by using the more full-featured ruby/setup-ruby action.

This action combines the functionality of both actions/setup-ruby and actions/cache — and makes it a bit easier to specify ruby versions, too.

Now specifying the ruby version in our .ruby-version file: Updated to 2.7.2.

Fixes #750.

@elstudio elstudio changed the title Update workflows to use gem caching and latest Ruby 2.6 feat: Update workflows to use gem caching and latest Ruby 2.6 Nov 19, 2020
with:
ruby-version: 2.6.x
ruby-version: 2.6

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

Looks like these can be dropped now and it will read the .ruby-version https://github.com/ruby/setup-ruby#supported-version-syntax

This comment has been minimized.

@elstudio

elstudio Nov 19, 2020
Author Collaborator

True. However, in .ruby-version we must specify the full 2.6.6 version — since rbenv requires a full version (it can’t work with 2.6).

I think it’s better to leave the major version in our workflows, which will automatically use the latest 2.6 patch.

Folks building locally with rbenv will still use the .ruby-version — and so I’ve matched that for now.

Downside of that approach is that it repeats ourselves, kinda. But I think it’s better to automatically get patch releases in our workflows. What do you think?

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

Fair enough. I think 2.7.1 is the latest for the pages setup though. I usually peak over at https://github.com/github/pages-gem/ when I'm looking to bump that

This comment has been minimized.

@elstudio

elstudio Nov 19, 2020
Author Collaborator

Yeah. And 2.7 will run a little faster. Tests do pass running locally with 2.7, so that looks okay.

Thinking about this a little more, since we have multiple workflows here, why don’t we leave the ruby version specification to .ruby-version. That way we have just one file to keep up to date, rather than 4 workflows, too.

So I’ll push that commit in a second here. You okay with that approach?

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

Yup, that works for me. I think I came across somewhere that had an automated way to pull down the info from an API to keep it in sync, but I don't recall were now

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

Looks like you cleaned up the other files, but not this one 😉

This comment has been minimized.

@elstudio

elstudio Nov 19, 2020
Author Collaborator

Whoops. Fixed now

gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rubocop -D -S
run: bundle exec rubocop -D -S -a

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

I don't think autocorrect makes sense for the CI. The CI will pass, even if there are issues in the checked in code as long as they are fixable

This comment has been minimized.

@elstudio

elstudio Nov 19, 2020
Author Collaborator

Oh yeah! Good catch!

This comment has been minimized.

@elstudio

elstudio Nov 19, 2020
Author Collaborator

Good side about my making dumb mistakes like this — gem caching really works!

This comment has been minimized.

@nschonni

nschonni Nov 19, 2020
Contributor

I hadn't seen that option before, so now I'm going to go update a few workflows for that cache seeing 😄

@elstudio elstudio changed the title feat: Update workflows to use gem caching and latest Ruby 2.6 feat: Update workflows to use gem caching and latest Ruby 2.7. Nov 19, 2020
Also remove ruby version here.
@elstudio elstudio merged commit bfec739 into gh-pages Nov 19, 2020
6 checks passed
6 checks passed
build build
Details
build build
Details
build build
Details
build build
Details
build build
Details
build build
Details
@mlinksva mlinksva deleted the add-caching branch Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.
X Tutup