From the course: Learning GitHub Actions: Event-Driven Automation for Your Codebase

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: Develop a CI/CD pipeline for a Python script

Solution: Develop a CI/CD pipeline for a Python script - GitHub Tutorial

From the course: Learning GitHub Actions: Event-Driven Automation for Your Codebase

Solution: Develop a CI/CD pipeline for a Python script

(bright music) - [Instructor] In this challenge, we used GitHub actions to create a three stage CI/CD pipeline for a Python script. The goal was to automate all the steps in a typical software development project, including linting, testing, creating an artifact, and then testing the artifact. Let's go over the solution. The application for this project is just a script that prints a friendly message. Using a simple script is great because we can focus on implementing the pipeline. The Docker file defines a container image that includes the Python script. After putting the code in place, we needed to create a workflow file. It was important to place this file inside the .github/workflows directory, or it wouldn't have been detected by GitHub actions. Let's walk through each job in this workflow. The first job is lint and test. It checks out the code, sets up the Python environment, and checks out the script for formatting. For the test portion of this job, it runs the script directly…

Contents