Automated testing using GitHub Actions... easier than I thought

Support and get Hazel ► / thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► / discord
Hazel ► hazelengine.com
🕹️ Play our latest game FREE (made in Hazel!) ► studiocherno.itch.io/saving-c...
🌏 Need web hosting? ► hostinger.com/cherno
📚 CHAPTERS
0:00 - Hello
4:31 - GitHub Actions overview
6:27 - How I set it up
💰 Links to stuff I use:
⌨ Keyboard ► geni.us/T2J7
🐭 Mouse ► geni.us/BuY7
💻 Monitors ► geni.us/wZFSwSK
#Hazel

Пікірлер: 94

  • @not_halls
    @not_halls7 ай бұрын

    the feeling when u realize what you were trying to do was actually something simple is good and bad at the same time

  • @ty.davis3

    @ty.davis3

    7 ай бұрын

    So true, you're relieved that you finally found the solution but kinda sad because you've already put so much effort into it

  • @andreferreira2456
    @andreferreira24567 ай бұрын

    Be careful with the admin permissions to the runner. You just opened up access to your desktop as well as your home network to anyone that pushes malicious code and triggers the action.

  • @therealjtgill

    @therealjtgill

    7 ай бұрын

    In B4 a patron replaces Hazel with a Bitcoin miner and makes a pull request

  • @pacifico4999

    @pacifico4999

    7 ай бұрын

    Absolutely. Not only that but also supply chain attacks.

  • @tronophono913

    @tronophono913

    7 ай бұрын

    @@therealjtgillI never thought of that. So even if you don't have your pull request approved the fact that the runner will test it makes it possible to run bad code without the owners knowing. I never thought of that I am pretty new to the whole cicd thing.

  • @Ironicnet

    @Ironicnet

    7 ай бұрын

    Ideally you can put the code inside a docker so it cannot access the host pc

  • @therealjtgill

    @therealjtgill

    7 ай бұрын

    @@tronophono913 Yep. This is something that happened with public repos on GH when GH started providing cloud runners. Attackers would look for repos with no/low security settings and basic workflow files, fork the repo, replace the functioning code with a miner, then make a pull request. The GH cloud runners would run the mining code and leave the repo owner with fees for running the instances. That being said, you can add permissions to GH repos that only allow certain users to start CI/CD runs without prohibiting pull requests. So a user can make a pull request, but only a trusted user would be allowed to kick off the workflows.

  • @Draggeta
    @Draggeta7 ай бұрын

    I love people who can come back and admit when they were incorrect/misinformed. I dont know how often colleagues have corrected/opened my eyes on wrong/old information. It only makes things better.

  • @Dr-Zed
    @Dr-Zed7 ай бұрын

    Modern CI/CD tools like GitHub Actions and GitLab CI are really nice to use.

  • @lorincmate

    @lorincmate

    7 ай бұрын

    Retrospectively i dunno how I was able to work without CI in the old days.

  • @hanes2

    @hanes2

    7 ай бұрын

    Gitlab is very nice when u work with separate groups and separate repos and what not..

  • @ApacheSenior
    @ApacheSenior7 ай бұрын

    Very nice. CI is a such a blessing, especially on cross platform code.

  • @davidandrewthomas
    @davidandrewthomas7 ай бұрын

    Be careful with PR builds and self-hosted runners, make sure to think about security. It can be pretty easy to accidentally allow arbitrary code execution on your machine. Or DoS, etc.

  • @alichamas63
    @alichamas637 ай бұрын

    The irony that a pro C++ dev thought that adding a YAML config file to their repo was "too hard". Good job seeing it through man, it'll make a big difference to QA.

  • @verminology9999
    @verminology99997 ай бұрын

    I hope you make another video when you setup all the run tests, too! Been wanting to setup something similar for a while now, so the video couldn't have come at a better time. Love the new format of these videos. Keep it up!

  • @Skeffles
    @Skeffles7 ай бұрын

    It's fantastic to see how you've implemented the test pipeline!

  • @Corgamos
    @Corgamos7 ай бұрын

    Please keep us updated with GitHub Actions, I would love to see the discussions about the new workflows added in the future!

  • @akhiln
    @akhiln7 ай бұрын

    Thanks, Cherno for the video! this is very helpful.

  • @MaKaNufilms
    @MaKaNufilms7 ай бұрын

    Watched your last video and was actually surprised, that you not thought about this kind of automation before. I think this was based on "Hey he is coming from EA, he should have done stuff before". That was absolutely a first an very naive thinking and I am very happy to see, that you guys try now. Keep up.

  • @rmt3589
    @rmt35897 ай бұрын

    That's awesome! Don't have a server to set this up on now, but will revisit once I do.

  • @CameronPenner

    @CameronPenner

    7 ай бұрын

    I've been building a bunch of my side projects using the free github runners lately. They give you quite a bit of free time, it's a great way to get started!

  • @boopumer
    @boopumer7 ай бұрын

    I have a flight in 2h and legit waited for this video to get published so I can download it

  • @Raptor-jv7fi

    @Raptor-jv7fi

    7 ай бұрын

    Have a safe flight! Enjoy!!

  • @JaceMorley
    @JaceMorley7 ай бұрын

    I think I'd have gone for self-hosting Jenkins before writing my own Python script, but the new CI-integration that hosting solutions are going with are pretty awesome.

  • @Jurasebastian
    @Jurasebastian7 ай бұрын

    9:40 waiting for chrome to introduce some css style that is applied for recording software so auther of website could automatically blur everything, something like streamer mode

  • @feschber
    @feschber7 ай бұрын

    Github actions are absolutely amazing. Since i use them i never pushed a broken commit on master anymore.

  • @Revin2402
    @Revin24027 ай бұрын

    Yes you are right github actions or azure pipelines initially add more overhead since you have to learn how and what you have to do to make it work. But glad you see that this will be beneficial in the long run since it's quite a better solution than setting up like a python script or anything. Currently also in the process of setting up my azure pipelines for my private project and it takes some time but I already know that this will be the better solution.

  • @BboyKeny
    @BboyKeny7 ай бұрын

    Really awesome!

  • @ilyashcherbakov4115
    @ilyashcherbakov41157 ай бұрын

    Something else you can do is add Required Checks so you don’t accidentally push a broken commit to main. Since it’s not very comfortable to do via GitHub Actions if you have a lot of Checks - you can add a step, like Wait For All Check to Complete and set it as a Required Check

  • @dav1dsm1th
    @dav1dsm1th7 ай бұрын

    Regarding the weirdness around windows not finding existing installs of python - I stumbled on what sounds like it may be a related issue a few days ago - hit the search box in windows and type "alias" - There's an option there that was new to me - Manage app execution aliases - in there are a bunch of aliases that override PATH variables and may have been the thing that caused your issue (it certainly did mine) - you only appear to be able to enable/disable the options that Microsoft creates - but it definitely adds at least 2 for Python that may havebeen screwing with you the way it did me. I'm guessing there's a registry hive that defines the list of aliases, but I lost interest after I fixed my problem. Thanks for the video, as always. Stay safe out there.

  • @peacefulexistence_
    @peacefulexistence_6 ай бұрын

    10:58 YAML, the lovely format with pointers that can DoS your computer if you don't parse it carefully.

  • @mitchellcampbell2775
    @mitchellcampbell2775Ай бұрын

    I've recently been trying to set up a Github Actions workflow for my university assignments (Qt applications built using CMake) to ensure cross-platform compatibility. However, I couldn't get this all to work as expected, and quickly thought it was just not worth the time and effort. After watching this, you have got me thinking: Perhaps this is easier than I thought? Even at a smaller scale, being able to automate certain processes is really a useful skill to have. I guess I know what I'll be doing this weekend...

  • @Wolverine30303x
    @Wolverine30303x7 ай бұрын

    Congratz on adding CI. It's great to see best practices in game dev. How do you plan to build on Linux? The MSBuild is not available there afaik - add CMake support?

  • @mcKrawll
    @mcKrawll7 ай бұрын

    The matrix will only run in parallel if you have more self-hosted runners that have those requirements. Otherwise they will use the same self-hosted runner and run sequentially.

  • @JohnYoung77
    @JohnYoung777 ай бұрын

    I've not seen the GitHub code (yet) for Hazel. But I am assuming there is a test harness for Hazel, besides the runtime tests?

  • @danBhentschel
    @danBhentschel7 ай бұрын

    Regarding running in parallel, I think it will only run one job at a time on a given runner. Since you only have one runner that satisfies all your tags, you won't get parallelism. There may be a way to configure more than one runner on your machine. I've never played with self-hosted before.

  • @200midgets6
    @200midgets62 ай бұрын

    could you do a follow up where you do an example with a simple c++ project with unit tests that get run via github actions?

  • @touchdepp4507
    @touchdepp45077 ай бұрын

    @16:42 don't let them run in parallel if they go to the same agent and you are doing performance tests like measuring time

  • @PedroOliveira-sl6nw
    @PedroOliveira-sl6nw7 ай бұрын

    I think this video will be one of your most watched videos ever. Not now. But in the future.

  • @Spongman
    @Spongman7 ай бұрын

    you could change your ASSERT macro to still check the validity of the condition in release builds: `do { if (false && (condition)) {} } while(0)`

  • @user-kw9cu
    @user-kw9cu7 ай бұрын

    🔥

  • @twenty-fifth420
    @twenty-fifth4207 ай бұрын

    Goodmorning from America! So, As someone who just pushed my first repo to Gitlab and looking at their form of ‘Actions’, I sort of got a bit overwhelmed so I went to my project lol. I am just glad I did my first git push. I had the feeling that CI/CD though on my own machine would be annoying to setup, so I am more then happy to let my provider do it. 🤷‍♂️ Idk, I could be wrong. Someone can gladly correct me. 😂

  • @peternjorogej
    @peternjorogej7 ай бұрын

    I have a question that's (almost) unrelated to the topic of this video. After building a game using the editor, how does the engine export the game as a standalone executable? PS: If the answer is too complicated, could you do a short explainer video?😅

  • @unkgames-abdullahali4048
    @unkgames-abdullahali40487 ай бұрын

    You're right

  • @defence.journey6552
    @defence.journey65527 ай бұрын

    I'm from India, how is the scope there for automation testing

  • @tooru
    @tooru7 ай бұрын

    Python doesn't require admin rights to install for user, not system.

  • @QckSGaming
    @QckSGaming7 ай бұрын

    Welcome to DevOps engineering! It's cool to see how easy it was to set up. I'm interested in the scaling challenges in the future. Parallel matrix builds might require an extra keyword but not only that, your runner might need extra an configuration flag to allow more than one workflow running at once. Often in CI platforms it's limited to one per runner, unless you are using some type of a Docker executor where each build runs in a container (this is an excellent reliability/reproducability improvement for the future!!)

  • @klaesregis7487
    @klaesregis74877 ай бұрын

    Seems this is a bit different than a Gitlab CI/CD pipeline? I would not want my hosted instance to install any software. If I would need specific software I either get a docker image or build one myself; which then is used in the Gitlab CI/CD pipeline. Granted I have only worked with Gitlab CI/CD yet.

  • @TurtleKwitty

    @TurtleKwitty

    7 ай бұрын

    The difference is this allows using the full power of the computer it runs on, which is what he wanted so in this case better for his use case with needing the GPU

  • @-rya1146
    @-rya11467 ай бұрын

    21:21 That is an issue I face a lot.

  • @gsestream
    @gsestream7 ай бұрын

    w00t

  • @jmac217x
    @jmac217x7 ай бұрын

    Properly evaluate CMake one day.

  • @attilamolnar3791
    @attilamolnar37917 ай бұрын

    Using docker compose you can even create multiple runners using only one machine. Most likely you can even use Kubernetes in some way to have a scaleble build farm :D

  • @OleZZ222
    @OleZZ2227 ай бұрын

    Has anybody the songs name at 0:22? Shazam can't find it :(

  • @sids911

    @sids911

    7 ай бұрын

    proabably from some audio asset library which can be licensed

  • @anon_y_mousse
    @anon_y_mousse7 ай бұрын

    I'll definitely be on the lookout for a Linux build. I'd like to give your engine a try, but I'm never going back to Windows.

  • @VanFS3K
    @VanFS3K7 ай бұрын

    Github actions is pretty easy, but it costs and the costs can add up.

  • @path_selector
    @path_selector7 ай бұрын

    wait hazel has a dev, QA, and prod branch? instead of 1 main? how come this was what you guys did

  • @avwie132
    @avwie1327 ай бұрын

    It’s amazing that something like automated testing using GitHub Actions is worth a video? Like… everybody outside the gaming business is doing testing with CI for at least a decade.

  • @Lefaseer

    @Lefaseer

    7 ай бұрын

    That's impressive for a service that was released 4 years ago.

  • @avwie132

    @avwie132

    7 ай бұрын

    Testing using CI pipelines isn’t. That’s what I meant. Not Actions specificy

  • @Lefaseer

    @Lefaseer

    7 ай бұрын

    @@avwie132 Well not everyone is doing automated testing for a decade, sadly. Game development might even be one of the better ones compared to engineering companies, banks and all kinds of places working with old tech and ancient practices.

  • @Lefaseer

    @Lefaseer

    7 ай бұрын

    And I think the video has value for someone who also wants to set up Actions specifically

  • @lufvilla
    @lufvilla7 ай бұрын

    The python problem could be that the runner is using a different "PATH" (Probably the admin does not have python on it?) Also, be careful with the admin privileges on a self-hosted runner, anyone can execute a script there. Good Stuff ✨

  • @barfourkyei3469

    @barfourkyei3469

    7 ай бұрын

    but tbh, it is just better to use the packaged ones that comes with github actions as it turns out to be very configurable.

  • @chestercopperpot3793
    @chestercopperpot37937 ай бұрын

    Create a dedicated admin account for the runner. System is god in Windows.

  • @JohnLudlow
    @JohnLudlow7 ай бұрын

    Don't install your runner as admin, there's not really a reason to do that here. Installing python can be done with an action that downloads a portable version to a folder and paths it up for you (edit: the setup-python docs say the default user NETWORK SERVICE should work), and having the pipeline be elevated just to set some symlinks to save some extra copying seems like micro-optimisation. Aside from the security risk pointed out by another user, pipelines work best when they are repeatable and always start from a known point, and having pipelines able to change the environment for future runs breaks that. Also I'd definitely look at running on master as well, though the value there depends on how you plan to release, to a degree.

  • @rush2sk8
    @rush2sk87 ай бұрын

    I wonder how far github has come compared to gitlab

  • @Dominik-K
    @Dominik-K7 ай бұрын

    CI / CD is really not that hard nowadays and making pipelines that work can be amazing

  • @pavlg3944
    @pavlg39447 ай бұрын

    My projects CI and building is very similar to Hazel, but I prefer Bash, Gradle and CMake.

  • @startrunning4461
    @startrunning44617 ай бұрын

    Character Development

  • @cnb_kevin
    @cnb_kevin7 ай бұрын

    "I was thinking about it in bed almost subconsciously" That's... that's actually a thing. I've been experimenting with it more and more as well as reviewing some methods/research that has been done on it.

  • @thomascd5952
    @thomascd59527 ай бұрын

    Hi, why is Jenkins not even mentioned ?? It seems to me the go to tool for CI/CD ?!

  • @epickh64
    @epickh647 ай бұрын

    Will you make a public website on which everyone can look if images look right; vote to categorize them so you and your team have less work? Then, the test suite automatically uploads images to that website and registered users can check if the rendering works.

  • @jacksmith3386
    @jacksmith33867 ай бұрын

    first

  • @IlliaZhdanov
    @IlliaZhdanov7 ай бұрын

    see? Github Actions is GOOD

  • @TheNeo2k
    @TheNeo2k7 ай бұрын

    Can't beat Jenkins..... Github Actions can do some of the starting checks, but the practical PC side, Jenkins hands down.

  • @spicygaming9528
    @spicygaming95287 ай бұрын

    Is it possible to get unbanned from The Cherno server?

  • @MM-24
    @MM-247 ай бұрын

    Does this sound like an Elon response to anyone else? It doesn't really matter... But seems like this epiphany came from comments and the sheer volume of viewers said it was easy (yes Cherno mentions that).... But makes it seem like...ohhh i was up thinking at night Reminds me of that time that YT reporter gives Elon an idea, and the next time they meet Elon says, "oh yea we were discussing a problem, and you made me think of a solution " completely invalidating that it was his idea completely

  • @N-oh4kk

    @N-oh4kk

    6 ай бұрын

    The idea doesn't mean shit. Execution is everything

  • @dimscrawl4910
    @dimscrawl49107 ай бұрын

    better, more code less talking and you'll get there

  • @xtrailz
    @xtrailz7 ай бұрын

    Why build a game engine in this day and age? there are already so many to choose from.