Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Getting started with GitHub Actions for Rust
Roger Torres (he/him/ele)
Roger Torres (he/him/ele)

Posted on

     

Getting started with GitHub Actions for Rust

TL;DR: Create an Action on GitHub so your code gets built and tested after every push, and do all this with nothing more than a "next-next-finish".

Younever used GitHub Actions and you want do do it with your Rust project; if that's the case, this might help you.

What is and Why GitHub Actions?

GitHub Actions automatize software workflow, whichper se isnot CI/CD (Continuous Integration/Continuous Delivery), but is used in this method.

So, which workflow are we going to automatize? Test and build. In other words, this:

$cargo test
$cargo build

Enter fullscreen modeExit fullscreen mode




How to do it

First, open your GitHub repository and go toActions.
GitHub Actions

The example is fromthis repository that I wrote abouthere.

This will lead you to this GitHub proposal, which will do exactly what we're set to do here, i.e., build and test:
Workflow proposal

GitHub will preview the.yml file it will create. For this scope, you don't have to change anything (except maybe thename from "Rust" to something else — I used "test").
yml preview

Commit the change clicking on the button that will appear on the right and the file will be created:
After commit

Now, if you go toActions again, you will see GitHub creating your.yml file. For me, it took around 2 minutes.
Building ymlyml built

And that's it. From now on, every time youpush against the repository, GitHub will run the tests for you.
After push

To see the result of the commit above, see theBuild loghere.


And that's all for today.

See ya 🙃

Cover image bySusan Q Yin

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

A dev who writes technical texts in ordinary language.
  • Joined

More fromRoger Torres (he/him/ele)

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp