Python, from Zero, for AILesson 89 of 89

Module 9 · Building the thing: a small AI program, end to end

GitHub Actions: the tests run on a machine that is not yours, before anything ships

In this lesson

  • 9 min read
  • 10 reading sections
  • Knowledge check
  • Lesson 10 of 10 in this chapter

This chapter’s goalAssemble a complete tool from the course’s parts (a chat loop with bounded history, injection-resistant prompt templates, a sqlite response cache, a document chunker, a local embedding search over your own notes, a free local model as the fallback provider) expose it through a Gradio interface and a FastAPI endpoint, run it on a schedule without double-processing, and gate every change behind a GitHub Actions job that runs the tests.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch1:39Not available
Full audiobookNot availableNot available
What happens on a machine that has never seen your projectYou pushGitHub starts a fresh Ubuntu machine with none of your setup on it.0:10Checkout brings only what git has. The fixture you never committed is not there.0:25pip install from your declared dependencies. The package left over in your venvfails here.1:05pytest runs on 3.11 and 3.12 at once, so syntax that arrived in 3.12 fails before auser meets it.1:40import tagger.Utils, fine on a Mac, fails on Linux, where case matters.ResultGreen, or a locked door: with the branch protected, the pull request cannot mergered.Every one of these is a bug that passes on your laptop. The runner’s value is precisely that itremembers nothing about you: it has only what git has, in the Python you declared, on a filesystemwhere filenames have case. Protect the branch and a red cross stops being a suggestion.
Every one of these is a bug that passes on your laptop. The runner's value is precisely that it remembers nothing about you: it has only what git has, in the Python you declared, on a filesystem where filenames have case. Protect the branch and a red cross stops being a suggestion.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 12Free · no account needed
Lesson steps

Works on my machine

Every test passing on your laptop proves the code works with your Python, your installed packages, your environment variables, your filesystem and the files you forgot to commit. A second machine with none of those proves the code works. Continuous integration is the habit of having that second machine run the tests on every change, automatically, before the change is merged. GitHub Actions provides the machine for free for public repositories and with a generous monthly allowance for private ones.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Divya, your AI tutor

How to cite: Addaly (2026) ‘GitHub Actions: the tests run on a machine that is not yours, before anything ships’, in Python, from Zero, for AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/python-for-ai/github-actions-ci (Accessed: 21 November 2026).