Welcome to the Programming Cafe!

Plan for today

Intro programming cafe 10 min
Getting Started with Git and GitHub 20 min
Exercises or Work on your own code 30 min
Automating things with GitHub Actions 20 min
Exercises or Work on your own code 30 min
Wrap-up 10 min
Drinks!

Programming Cafe

  • R-Cafe
  • Community event
  • Themes
  • Presentations
  • Work on your own code
  • Exercises
  • Interaction

Getting Started With Git & GitHub

Research Data Management Support

Why Git and GitHub?

The final-final-final circle of hell.

Why Git and GitHub?


Do you need to:

  • backup your code?
  • better version control your code?
  • collaborate more easily?
  • share and publish your code?
  • work in line with open science and the FAIR principles?

Then Git & GitHub is something for you!

What is Git?

  • VCS = Version Control Software.
  • Free and open-source.
  • Original Domain: Software Development.
  • Nowadays Git is being ‘repurposed’ beyond software development.

What is GitHub?

An online repository, based on Git software, for:

  • storing with version control
  • collaboration
  • publishing
  • project management
  • and more!

Benefits of using Git & GitHub for researchers

Benefits of using Git & GitHub for researchers (1/4)

Rigid structure of git helps manage project evolution. Main/master copy on GitHub enables sane experimentation and collaboration.

Benefits of using Git & GitHub for researchers (2/4)

Manage your code (and other files) down the very last details. Experimentation is facilitated!

Benefits of using Git & GitHub for researchers (3/4)

Version Control & Project History. Like track changes in your Word document, which is also backed up on OneDrive - but BETTER!

Benefits of using Git & GitHub (4/4)

The software & platform is built to facilitate for Collaboration.

Benefits of using Git & GitHub for researchers

In short:

  • Free and open-source
  • Efficient
  • Transparent
  • Reliable
  • Backups and Version Control
  • Collaboration
  • Sharing and Reuse

The Git & GitHub Dream

A GitHub Repository

Git takes snapshots of all the files in a folder. This folder is called a repository or repo.

GitHub Repository for the Programming Cafe

A GitHub Repository

Git takes snapshots of all the files in a folder. This folder is called a repository or repo.

Here’s the same repository, but locally on our computer.

How do I get started with Git?

The simplest starting point, however, is GitHub in the web browser!

Exercise!

Check out utrechtuniversity.github.io/programming-cafe/

You can try out any of the exercises, we do have some recommendations based on today’s presentation:

  • For beginners, the Introduction to GitHub exercise is a nice start. You’ll make a short Markdown file you can use as your profile README and learn about repositories, branches, commits, and pull requests while doing so!

  • For experienced users, the Hello GitHub Actions exercise is a great introduction to the topic.

GitHub @UtrechtUniversity

https://github.com/UtrechtUniversity

Getting Started With GitHub Actions

Research Data Management Support

What is GitHub Actions

  • Free GitHub service
  • Perform tasks on the servers of GitHub
  • Events/scheduled times

Why using GitHub Actions?

Automation of:

  • Testing
  • Deploying
  • Packaging/publishing
  • Parsing/rendering
    • GitHub Pages
    • Websites
    • Documentation
  • Other stuff

Cool features:

  • Test on several Operating systems (e.g. Windows, macOS, Ubuntu)
  • Simultaneous testing across multiple operating systems and versions
  • Multi-container testing (Docker-compose)
  • Creating and reusing actions from GitHub Marketplace
  • Interact with GitHub API (e.g. comment on pull request, create issues)

Getting started



Example

Terminology

Action

An action is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task (e.g. installing Python). Use an action to help reduce the amount of repetitive code that you write in your workflow files.



Event

An event is a specific activity in a repository that triggers GitHub Actions to start. For example, activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger GitHub Actions on a schedule.

Terminology


Jobs

A job is a set of steps in a workflow that execute on the same runner (or server). Each step is either a shell script/command that will be executed, or an Action that will be run. Steps are executed in order and are dependent on each other.



Workflow

A workflow is one (or a set of) job(s) that are defined in a script (YAML file) and triggered by events

Terminology


Runner

A runner is a server that runs your workflows when they’re triggered. Each runner can run a single job at a time. GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners to run your workflows; each workflow run executes in a fresh, newly-provisioned virtual machine.



Further reading

Summary

Exercises



https://utrechtuniversity.github.io/programming-cafe/