Intro to CI/CD Part 2: Getting Started with GitHub Actions | Digi-Key Electronics

Опубликовано: 01 Октябрь 2024
на канале: DigiKey
22,868
199

Continuous Integration and Continuous Delivery (CI/CD) is the process of automating the testing and deployment of a software project. It is often used in large-scale, multi-person projects, but it can be useful in smaller projects and embedded firmware development. This tutorial shows you how to use GitHub Actions to automate many of the testing, integration, and delivery processes found in CI/CD. Note that GitHub Actions is unique to the GitHub platform.

You can view a written version of this tutorial here: https://www.digikey.com/en/maker/proj...

CI/CD often relies on fully automated processes, which means creating programs to test your main program(s). CI/CD frameworks can take a variety of forms, and one popular framework uses GitHub actions to automatically run scripts on particular events (e.g. each time a new change is pushed to the repository).

In the previous episode (   • Intro to CI/CD Part 1: Getting Starte...  ), we looked at how Docker images can be used to run test scripts. This time, we turn to the popular GitHub platform to run such tests for us using GitHub Actions.

We create our own workflow in GitHub Actions to automatically compile, build, and run our simple “Hello, World” C program. A workflow consists of one or more “jobs” that are triggered by an “event.” These events can be nearly any interaction with a GitHub repository, such as cloning, pushing, or opening a pull request. On each viable event, the workflow runs, executing the included jobs.

These jobs run in a virtual machine or Docker container. In this episode, we will use the officially supported Ubuntu virtual machine to run our jobs. The workflow starts the virtual machine and installs any dependencies we list in our configuration YAML file. From there, it runs our Python test script, which compiles and runs the simple C program. The test script can monitor the output of the compilation and execution of the C program to ensure everything runs correctly. The GitHub Actions dashboard provides the status of the workflows along with any errors that might have been encountered.

Related Video:
Intro CI/CD Part 1: Getting Started with Docker:    • Intro to CI/CD Part 1: Getting Starte...  

Related Project Link:
Getting Started with Docker: https://www.digikey.com/en/maker/proj...

Related Article:
How to Install and Get Started with Node-RED: https://www.digikey.com/en/maker/blog...

Learn more:
Maker.io - https://www.digikey.com/en/maker
Digi-Key’s Blog – TheCircuit https://www.digikey.com/en/blog
Connect with Digi-Key on Facebook   / digikey.electronics  
And follow us on Twitter   / digikey