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

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 97

  • @not_halls
    @not_halls Рік тому +86

    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 Рік тому +2

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

  • @Draggeta
    @Draggeta Рік тому +19

    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-Zed Рік тому +24

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

    • @lorincmate
      @lorincmate Рік тому +3

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

    • @hanes2
      @hanes2 Рік тому

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

  • @ApacheSenior
    @ApacheSenior Рік тому +31

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

  • @andreferreira2456
    @andreferreira2456 Рік тому +125

    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 Рік тому +23

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

    • @pacifico4999
      @pacifico4999 Рік тому +9

      Absolutely. Not only that but also supply chain attacks.

    • @tronophono913
      @tronophono913 Рік тому +8

      @@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 Рік тому +5

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

    • @therealjtgill
      @therealjtgill Рік тому

      @@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.

  • @Corgamos
    @Corgamos Рік тому +1

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

  • @alichamas63
    @alichamas63 Рік тому +9

    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.

  • @biggiefrosty
    @biggiefrosty Рік тому +11

    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.

  • @peacefulexistence_
    @peacefulexistence_ Рік тому

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

  • @MaKaNufilms
    @MaKaNufilms Рік тому

    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.

  • @Skeffles
    @Skeffles Рік тому

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

  • @dav1dsm1th
    @dav1dsm1th Рік тому +1

    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.

  • @verminology9999
    @verminology9999 Рік тому

    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!

  • @touchdepp4507
    @touchdepp4507 Рік тому

    @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

  • @ilyashcherbakov4115
    @ilyashcherbakov4115 Рік тому +1

    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

  • @mitchellcampbell2775
    @mitchellcampbell2775 8 місяців тому

    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...

  • @Jurasebastian
    @Jurasebastian Рік тому +3

    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

  • @JaceMorley
    @JaceMorley Рік тому +2

    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.

  • @feschber
    @feschber Рік тому

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

  • @rmt3589
    @rmt3589 Рік тому +1

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

    • @CameronPenner
      @CameronPenner Рік тому +1

      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!

  • @danBhentschel
    @danBhentschel Рік тому

    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.

  • @boopumer
    @boopumer Рік тому +8

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

  • @Revin2402
    @Revin2402 Рік тому +1

    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.

  • @mcKrawll
    @mcKrawll Рік тому +3

    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.

  • @akhiln
    @akhiln Рік тому

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

  • @Wolverine30303x
    @Wolverine30303x Рік тому

    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?

  • @Spongman
    @Spongman Рік тому

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

  • @PedroOliveira-sl6nw
    @PedroOliveira-sl6nw Рік тому

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

  • @JohnYoung77
    @JohnYoung77 Рік тому +1

    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?

  • @tooru
    @tooru Рік тому +1

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

  • @JohnLudlow
    @JohnLudlow Рік тому +1

    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.

  • @BboyKeny
    @BboyKeny Рік тому

    Really awesome!

  • @twenty-fifth420
    @twenty-fifth420 Рік тому

    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
    @peternjorogej Рік тому

    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?😅

  • @briumphbimbles
    @briumphbimbles Рік тому +1

    Yeah no idea why you didnt do this from the start. Using devops, github or another system to run tests on PR/ commit sounds like ... well a normal practice.

  • @QckSGaming
    @QckSGaming Рік тому

    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!!)

  • @OleZZ222
    @OleZZ222 Рік тому

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

    • @scion911
      @scion911 Рік тому

      proabably from some audio asset library which can be licensed

  • @VanFS3K
    @VanFS3K Рік тому

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

  • @unkgames-abdullahali4048
    @unkgames-abdullahali4048 Рік тому

    You're right

  • @defence.journey6552
    @defence.journey6552 Рік тому

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

  • @-rya1146
    @-rya1146 Рік тому

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

  • @klaesregis7487
    @klaesregis7487 Рік тому

    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 Рік тому

      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

  • @int-64
    @int-64 Рік тому

    🔥

  • @camrws
    @camrws Рік тому

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

  • @chestercopperpot3793
    @chestercopperpot3793 Рік тому

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

  • @jmac217x
    @jmac217x Рік тому +5

    Properly evaluate CMake one day.

  • @attilamolnar3791
    @attilamolnar3791 Рік тому

    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

  • @pavlg3944
    @pavlg3944 Рік тому +1

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

  • @sh335-s7x
    @sh335-s7x 5 місяців тому

    It gets annoying when it's a private repo. Creating SSH key, copying it, sshing the machine and running jobs is a pain in the a$$ bcuz it fails sometimes (like a lot of times) if the configuration isn't right.

  • @cnb_kevin
    @cnb_kevin Рік тому

    "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.

  • @lufvilla
    @lufvilla Рік тому

    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 Рік тому +1

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

  • @avwie132
    @avwie132 Рік тому +4

    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 Рік тому

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

    • @avwie132
      @avwie132 Рік тому

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

    • @Lefaseer
      @Lefaseer Рік тому

      @@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 Рік тому

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

  • @Dominik-K
    @Dominik-K Рік тому +1

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

  • @anon_y_mousse
    @anon_y_mousse Рік тому

    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.

  • @rush2sk8
    @rush2sk8 Рік тому +1

    I wonder how far github has come compared to gitlab

  • @gsestream
    @gsestream Рік тому

    w00t

  • @thomascd5952
    @thomascd5952 Рік тому

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

  • @epickh64
    @epickh64 Рік тому +1

    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.

  • @startrunning4461
    @startrunning4461 Рік тому +1

    Character Development

  • @spicygaming9528
    @spicygaming9528 Рік тому +1

    Is it possible to get unbanned from The Cherno server?

  • @IlliaZhdanov
    @IlliaZhdanov Рік тому +2

    see? Github Actions is GOOD

  • @TheNeo2k
    @TheNeo2k Рік тому

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

  • @jacksmith3386
    @jacksmith3386 Рік тому

    first

  • @azerial
    @azerial 2 місяці тому

    🙄

  • @MM-24
    @MM-24 Рік тому

    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 Рік тому

      The idea doesn't mean shit. Execution is everything

  • @dimscrawl4910
    @dimscrawl4910 Рік тому

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

  • @xtrailz
    @xtrailz Рік тому

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