Exercise - Create the CI workflow on GitHub
In this lab, you will learn how to create a Continuous Integration (CI) workflow using GitHub Actions. CI is a development practice where developers integrate code into a shared repository frequently, and each integration is verified by an automated build and tests. This helps catch bugs early and improves software quality.
You will learn how to:
- Understand Continuous Integration concepts
- Create a CI workflow with GitHub Actions
- Configure automated testing
- Run builds and tests automatically
- View test results and build status
- Integrate CI into your development process
This lab takes approximately 30-45 minutes to complete.
Before you start
To complete the lab, you need:
- A GitHub user account. If you don't have one, you can create a new account. If you need instructions on how to create a GitHub account, refer to the article Creating an account on GitHub.
- Basic understanding of GitHub Actions (recommended to complete "Hello GitHub Actions" first).
- A web browser with access to the internet.
Complete the exercise on GitHub
In this exercise, you'll create a CI workflow through a hands-on GitHub Skills exercise.
Note: This exercise is hosted on GitHub Skills and provides an interactive learning experience. You'll set up automated testing that runs every time code is pushed or a pull request is created.
The exercise consists of the following activities:
-
Start a web browser and navigate to the exercise repository: https://github.com/skills-dev/test-with-actions
-
On the exercise page, select the Use this template button to copy the exercise to your GitHub account.
Note: Simply copy the exercise to your account, then give GitHub about 20 seconds to prepare the first lesson, then refresh the page.
-
Follow the instructions on the repository's README to complete all the challenges, which include:
- Understanding CI principles and why they're important
- Creating a test workflow that runs automatically
- Configuring test jobs with proper dependencies and environments
- Running tests on multiple platforms (matrix builds)
- Adding status checks to pull requests
- Viewing test results in the Actions tab
- Debugging failed tests using workflow logs
- Requiring CI checks before merging
-
Work through each step in the exercise, following the prompts and instructions provided.
Note: CI workflows typically run on every push and pull request, ensuring that all code changes are automatically tested before being merged.
-
When you finish all the challenges, you'll have a fully functional CI pipeline that automatically tests your code.
What you've learned
After completing this exercise, you should be able to:
- Understand Continuous Integration principles and benefits
- Create CI workflows with GitHub Actions
- Configure automated testing for your projects
- Run builds and tests on multiple environments
- Use matrix strategies for testing across platforms
- View and interpret test results
- Debug failing tests using workflow logs
- Implement CI best practices
- Require status checks before merging code
Congratulations! You've completed the "Create the CI workflow on GitHub" exercise and learned how to implement Continuous Integration!