What you will learn in this TP
- Create a repository and a workflow
- Test on a version matrix
- Use cache, artifacts and summary
- Block merging if tests fail
All steps and instructions are shown. Recommended for this lab: guided
Introduction #
Context. The shop must run on Python 3.12 and 3.13. You want proof, on every push and pull request, that both versions pass the tests.
Prerequisites: a free GitHub account, Git, Python 3 and the gh CLI · Estimated time: 40 min
A green workflow on two Python versions, with reports as artifacts and a readable summary.Setup #
Guided steps, with their solution.
1. Create the project
Why? A locally testable project guarantees CI checks the same thing as you.
Create theboutiqueservice and run the tests locally.2. Publish the repository
Why? The gh CLI creates and links the repository in one command.
Create the publicboutiquerepository and push themainbranch.3. Write the workflow
Why? A matrix tests several versions without duplicating the job.
Create.github/workflows/ci.yml(3.12/3.13 matrix, pip cache, JUnit report as artifact, summary, concurrency), push and follow the run.4. Protect main
Why? Without a required check, a failing pull request can still be merged.
Create a repository rule onmainrequiring thetest (3.12)andtest (3.13)checks, then open a pull request that breaks a test and see it blocked.
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
GitHub Actions: concepts and how it works
Discover GitHub Actions: events, workflows, jobs, steps and actions, the Marketplace, hosted runn...
Writing GitHub Actions workflows
Mastering workflow syntax: triggers and filters, jobs and needs, matrices, if conditions, context...
End-to-end CI/CD (2/5): continuous integration, testing and quality
Succeed with continuous integration: the test pyramid, unit, integration, contract and end-to-end...
k6 in continuous integration and on Kubernetes (k6-operator)
Automate performance tests: k6 in GitHub Actions and GitLab CI with blocking thresholds, distribu...
Writing a .gitlab-ci.yml: jobs, rules, cache and artifacts
Mastering .gitlab-ci.yml syntax: stages, jobs and images, rules and workflow, needs (DAG), cache ...
Reusing and securing GitHub Actions workflows
Industrializing GitHub Actions: reusable workflows, composite, JavaScript and Docker actions, lea...
End-to-end CI/CD (5/5): GitHub Actions, GitLab CI, Jenkins and Argo CD in practice
Compare and use CI/CD tools: GitHub Actions, GitLab CI, Jenkins, Argo CD and Flux; a complete pip...
GitLab CI/CD: concepts and architecture
Discover GitLab CI/CD: the DevSecOps platform, the .gitlab-ci.yml file, pipelines, stages and job...
End-to-end CI/CD (1/5): principles and anatomy of a pipeline
Understand end-to-end CI/CD: continuous integration, continuous delivery and continuous deploymen...