RousselTMLEARNING

TP · GitHub Actions: from discovery to expertise

Lab: First continuous integration workflow

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
Mode :

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. 1. Create the project

    Why? A locally testable project guarantees CI checks the same thing as you.

    Create the boutique service and run the tests locally.
  2. 2. Publish the repository

    Why? The gh CLI creates and links the repository in one command.

    Create the public boutique repository and push the main branch.
  3. 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. 4. Protect main

    Why? Without a required check, a failing pull request can still be merged.

    Create a repository rule on main requiring the test (3.12) and test (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

  • ⏱ Estimated time : ≈ 40 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

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

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!