Skip to content

Simple GitHub Actions example for the Data Club on the 30th of April at DTU biosustain and DTU bioengineering

Notifications You must be signed in to change notification settings

biosustain/dsp_actions_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Data Club on GitHub Actions - Simple example

by Henry Webel from the Data Science Platform at DTU biosustain

Pre-requisites

Annoucement

GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that helps you to automate your build, testing, and deployment pipeline. Therefore, it makes sure your software remains reliable by catching bugs or dependency conflicts whenever your code (or its dependencies) change. It also helps you avoid accidentally skipping important checks that you would normally perform manually.

We will focus on introducing the core concepts of workflows and jobs in a hands-on manner using a simple hello-world example. We will also show some more elaborated examples as an outlook for interested users. Prerequisite is that you have a GitHub account and some familiarity with the command line. We do the tutorial on GitHub Codespaces using VSCode(see intro).

It will make most sense to attend if you want to use GitHub Actions (or similar on GitLab or BitBucket) on repositories where you maintain your package or analysis code. After this Data Club, it will be easier for you to implement basic automated checks,

  • e.g. format checkers or lint checkers - for catching common errors or pitfalls on your code.

Agenda

Date 30th April, 10-12 am

  • 10:00 - 11:20 Github actions including theory and hands-on
  • 11:20 - 12:00 Sandwiches and networking

Location: building 208 – room 002 (ALC3)

Content of the tutorial (this repository)

A simple example of a GitHub Action workflow that run command line commands.

Exercises

Simple

Starting with the basic exercise of executing something on the command line.

  1. Create a fork and open the fork in a GitHub Codespace
  2. Add two jobs which use either cowsay or cowpy
    • Separate installation and usage into separate steps
# first job
## install step:
pip install cowsay # install cowsay
## usage step:
cowsay -c cheese -t  'hey there' # use cowsay

and

# second job
# https://github.com/jeffbuttars/cowpy
pip install cowpy # install cowpy

cowpy -c tux hi there # use cowpy

Medium

Not all details are provided for the solution. It hopefully helps to build your own understanding of GitHub Actions.

Call it from a script (to understand file structure).

  • You will need the file (e.g. called examples.py)
  • Copy examples from cowpy README.md

Advanced

Build a directed acyclic graph combining jobs

  • Look at the extended examples' workflows below to figure this out

Extended example

Check out my Python package template for a more evolved example:

Or have a look at our VueGen repository for a live project with continoues integration and deployment using GitHub Actions.

About

Simple GitHub Actions example for the Data Club on the 30th of April at DTU biosustain and DTU bioengineering

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published