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
Convert CircleCI to GitHub Actions #23608
Conversation
12aa9bb
to
6111ca2
Compare
.github/workflows/build-and-test.yml
Outdated
- run: yarn install --frozen-lockfile | ||
- name: Precompile assets | ||
# Previously had set this, but it's not supported | ||
# export NODE_OPTIONS=--openssl-legacy-provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this one was used for, as current Node throws a warning/error using this flag in the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was used because OpenSSL 3 doesn't support some of the algorithms used by webpack. Without it, on some node versions, this would result in the build failing with loads of errors like this:
ERROR in chunk public [initial]
js/public-73f580d0c8328bbd755f.chunk.js
/home/claire/Sources/GIT/mastodon/node_modules/babel-loader/lib/index.js??ref--8-0!/home/claire/Sources/GIT/mastodon/app/javascript/mastodon/load_keyboard_extensions.js
error:0308010C:digital envelope routines::unsupported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. Looks like it's not an issue/supported, because the version in .nvmrc
is still on the v16 release line, and the OpenSSL 3.0 was a 17+ thing https://stackoverflow.com/questions/69962209/what-is-openssl-legacy-provider-in-node-js-v17
This pull request has merge conflicts that must be resolved before it can be merged. |
6111ca2
to
54d414a
Compare
Thank you for the very good Pull Request! But I would like to see how much the Queue is used by moving the whole thing to GitHub Actions, so I would like to see the Pull Request split into several separate Pull Requests for each task. |
Definitely! I think separate from this, because it might not land, I'll split off the Jest testing, since it doesn't seem to rely on the other steps. I think the migration tests could also have some sort of filter on them. Would it just be for any changes to |
@ClearlyClaire I had to revert #23571 to make Ruby 2.7 happy. That doesn't seem like the right fix though, would you have any ideas? |
This pull request has merge conflicts that must be resolved before it can be merged. |
dfa0158
to
dfb3beb
Compare
540a611
to
04b42dc
Compare
What made it unhappy? |
Ah, sorry, the rebase meant the previous builds with the message got cleared, but you can see the same message from my fork's build:
https://github.com/nschonni/mastodon/actions/runs/4186815456/jobs/7255893357#step:11:21 |
https://gorails.com/blog/bundler-default-gem-dependency-error suggests updating installed gems, but I wonder if that's the correct solution |
I'll give that a try. Looks like 2.7 only has a little over a month till EOL https://endoflife.date/ruby so maybe something that will go away with that |
@ClearlyClaire looks like adding a conditional |
Hmm, weird one about the performance between the two providers.
GitHub Actions:
Actions seems 4 times slower, but is also executing that many more tests??? |
a7db0f0
to
56d1dc7
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
1936788
to
c515e8b
Compare
f4fc534
to
8916349
Compare
e130d00
to
28e1cce
Compare
OK, I think with the Let me know if you want me to cleanup the commits |
|
||
services: | ||
postgres: | ||
image: postgres:14.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike CircleCI, this could be changed to the floating 14
run: gem update --system | ||
|
||
- name: Load database schema | ||
run: './bin/rails db:create db:schema:load db:seed' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this should actually be
run: './bin/rails db:create db:schema:load db:seed' | |
run: bundle exec rails db:create db:schema:load db:seed |
- name: Load database schema | ||
run: './bin/rails db:create db:schema:load db:seed' | ||
|
||
- run: bundle exec rake rspec_chunked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The coverage setup can still be used https://github.com/owen2345/rspec_chunked#coverage-merge-reports-when-using-simplecov but I backed out the CodeCov parts of this branch
pull_request: | ||
|
||
env: | ||
BUNDLE_CLEAN: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if these are all still needed, but I left them from the migration
DISABLE_SIMPLECOV: true | ||
RAILS_ENV: test | ||
ALLOW_NOPAM: true | ||
PAM_ENABLED: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the PAM stuff should go into a separate matrix job
PAM_DEFAULT_SERVICE: pam_test | ||
PAM_CONTROLLED_SERVICE: pam_test_controlled | ||
BUNDLE_WITH: 'pam_authentication' | ||
CI_JOBS: ${{ matrix.ci_job }}/4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could fan out further, but I think the 4 like CircleCI uses seems to give enough speedup
- '2.7' | ||
- '3.0' | ||
- '3.1' | ||
- '.ruby-version' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also update the title to spell this out by overriding the name
for the job
- '.ruby-version' | |
- '.ruby-version' # Currently set to 3.2 |
I've removed the CircleCI config completely, so the branch protection rules would need to be updated to merge this |
CircleCI was fanning out the jobs to 4 workers at once to speed up the completion. This is now happening on the GitHub Actions too, but it's more visible in the UI |
I felt like this is just running the same job 4 times... but if it's on purpose that's fine. |
Right, the |
The tests do not seem to be marked as required for merge anymore. Can that be changed? |
This is nice overall (circle ci to GH actions) even if visually kinda loud now. Well done. I'm not at all a GH actions expert -- but I'm curious about the interaction of the build and test sections ... is it more or less the case that everything done in If so -- is it possible to move anything else out of test and into build? Specifically:
|
They're not reliant on the ruby version, but the runners for each of the matrix builds are new environments, so they need to be installed for each (if they're required). |
@ClearlyClaire if you have admin settings on the repo, I think the updated branch policy would look something like this |
Co-authored-by: Nick Schonning <nschonni@gmail.com>
I tried out https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer but mostly had to redo it anyway.
There is still an issue with the Ruby 2.7 build I'm not sure how to fix, so opening this up to see if someone else has an idea.