Continuous Integration / Continuous Development (CI/CD) - Github Edition

GitHub is a distributed git platform used for code hosting and collaboration. It can also be used to automatically run the hosted code on Github’s servers via GitHub Actions. Actions are workflow automation scripts. We’ll learn how to develop on to make our code robust to errors, preserved, and reproducible.

The aim of this module is to:

Prerequisites

This assumes that you’ll have some basic background with your command line, for example:

  1. How to execute custom shell scripts (if you are not familiar with the shell, click here)
  2. How to run python scripts (if you are not familiar with python, click here)
  3. How to interact with remotes in git (if you are not familiar with git, click here; for simplified authentication with the gh command line interface, see this version of the git training)

The skills we’ll focus on:

  1. Making scripts exit correctly
  2. Building a CI/CD workflow of unlimited potential
  3. Understanding how job runners work (and get access to your clones)
  4. Protecting secret information while allowing jobs to run

HSF Software Training

HSF Logo
This training module is part of the HSF Software Training Center, a series of training modules that serves HEP newcomers the software skills needed as they enter the field, and in parallel, instill best practices for writing software.

Schedule

Setup Download files required for the lesson
00:00 1. Introduction What is continuous integration / continuous deployment?
00:05 2. Exit Codes What is an exit code?
00:25 3. Being Assertive What happens with assertions in python?
00:35 4. Understanding YAML What is YAML?
00:40 5. YAML and GitHub Actions What is the GitHub Actions specification?
00:45 6. Coffee break! Get up, stretch out, take a short break.
01:00 7. Hello CI World How do I run a simple GitHub Actions job?
01:15 8. Adding CI to Your Existing Code I have code already in GitHub, how can I add CI to it?
01:30 9. Matrix How can we make job templates?
01:45 10. Coffee break! Get up, stretch out, take a short break.
02:00 11. Dependent Jobs How do you make some jobs run after other jobs?
02:10 12. A Skimmer Higgs How can I run my skimming code in the GitHub Actions?
02:25 13. Getting into the Spy Game How can I give my GitHub actions private information?
02:40 14. Making Plots to Take Over The World How do we make plots?
02:55 15. Let's Actually Make A Test (For Real) How does a realistic workflow look for a physics analysis?
03:20 16. Homework Where to go next?
Want some homework?
03:50 17. Bonus Episode: Building and deploying a Docker container to Github Packages How to build a Docker container for python packages?
How to share Docker images?
04:30 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.