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

chore: update github actions #339

Merged
merged 2 commits into from
Jan 20, 2024
Merged

chore: update github actions #339

merged 2 commits into from
Jan 20, 2024

Conversation

LucasFA
Copy link
Contributor

@LucasFA LucasFA commented Jan 19, 2024

Summary of changes:

  • Update several actions to the latest version (actions/checkout, docker/{buildx, login, setup-buildx, build-push-action}
  • Migrated actions from actions-rs to dtolnay/rust-toolchain. The former has been archived, the latter has become popular with many larger projects. actions-rs/cargo migrated to run steps.
  • Add one rust beta toolchain to CI testing. I only included Ubuntu, figured once is enough. This can be discarded if you want, really. Just to make sure there are no compiler bugs that would soon become an obstable to building the project.
  • Add rustc version to actions/cache cache-key, add a restore-keys argument for increased cache hits. Given that target/ is not cached really you can make it hit cache everytime, I think.

I have tested in my own repo the CI and the docker deployment actions.

IMPORTANT NOTES:

  • the docker/login-action documentation now plain asks, rather than recommends, using a token for access instead of the password. I gather it will still work with a password, though.
  • The CD workflow breaks when updating either the checkout action or the toolchain action. This results in the ubuntu machines cross compiling (and these are the only affected) to break. I've left this as is, but it may be that the containers are not updated anymore; last update was 2 years ago: link to rustembedded dockerhub page.

Other information: about those warnings in the actions log:

Migrate from actions-rs/* to dtolnay/*, update other actions to latest
versions.

The actions-rs was archived not long ago, and while the actual result
will not change, this prevents github action warnings.

Also reorders the actions to have an early failure with cargo fmt, and
added the beta toolchain to the CI workflow

In CD use checkout@v3 to avoid missing glibc issues
As the compiled libraries are not compatible version to version; read
rustc error [E0514]

Regarding restore-keys, many builds do not get their dependencies cached
because of it being missing. Many libraries will be the same even if the
lockfile changes slightly
Copy link
Owner

@aome510 aome510 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I'm not too familiar with GH actions, so really appreciate the improvement!

@aome510 aome510 merged commit 20df494 into aome510:master Jan 20, 2024
4 checks passed
@LucasFA
Copy link
Contributor Author

LucasFA commented Jan 21, 2024

Glad to contribute. I will test what can be seamlessly updated in the CD workflow, too.

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.

2 participants