0% found this document useful (0 votes)
6 views20 pages

Wilf Wilson

Uploaded by

The Learner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views20 pages

Wilf Wilson

Uploaded by

The Learner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

An introduction to

GitHub Actions
by Wilf Wilson

GAP Days Spring 2021

Sometimes relevant links will appear at the bottom, for later exploration.
Outline

• The conceptual purpose of GitHub Actions

• Why we’re talking about this now

• A brief look at GitHub Actions in… action

• Then Sergio:

Doing GAP package CI with GitHub Actions

!2
GitHub Actions at its most basic

• In a GitHub repository…

• …when a particular event happens…

• …run a sequence of tasks.

(Remotely, for free*, in a dual core virtual machine, with 7 GB


RAM, 14 GB storage, running Windows, macOS, or Ubuntu.)

!3
Examples of triggers/events
• A new commit is pushed to a branch

• Someone opens/edits a pull request

• Someone closes an issue

• A new release is made

• Another GitHub Action finishes running

• It’s 9:20 am

• Manual triggering

!4
https://docs.github.com/en/actions/reference/events-that-trigger-workflows
Examples of tasks
• Run regression tests

• Calculate code coverage

• Profile performance

• Update a website

• Prepare a new release

• Build the manual

• Check code formatting

!5
https://github.com/marketplace?type=actions
Example workflows
A “workflow” is a unit consisting of configurations and tasks.
Examples:

• When a pull request is made: run the regression tests,


and see if new code has test coverage.

• Every morning at 8am, prepare a release of your software.

• Every time there’s a new release, download it, check that


it works, and update a website.

!6
Benefits

• Automation can save time

• Automation is consistent

• Automation aids decentralisation and transparency

• It reduces your need for computer resources

• It offers a wide range of easy configurations

!7
Costs & difficulties

• Takes some effort to set up

• The virtual machines are not supercomputers

• Easy configuration options are not endless*

• You don’t have full control over the remote machines*

• No guarantee that it will be around forever…

!8
Why now?
GitHub Actions is new, powerful, useful for release process.

Competing/similar services:

• AppVeyor

• Azure Pipelines

• Jenkins

• Travis: no longer a realistic option; move away from it!

https://docs.github.com/en/actions/learn-github-actions/migrating-from-travis-ci-to-github-actions
Rough practical aspects of
how GitHub Actions works

• A workflow exists as a YAML file in .github/workflows/

• Structure: configuration options & a sequence of actions

• GitHub keeps track & runs workflows as appropriate

• The results are shown in the “Actions” tab on GitHub, and


on corresponding pull request pages

https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions
How GitHub Actions look on GitHub

!11
v

The workflows directory…

https://github.com/gap-system/gap/tree/master/.github/workflows
A workflow file…

https://github.com/gap-system/gap/blob/master/.github/workflows/CI.yml
The “Actions” tab…

https://github.com/gap-system/gap/actions
One particular run…

https://github.com/gap-system/gap/actions/runs/551986043
One particular job…
https://github.com/gap-system/gap/runs/1864784244?check_suite_focus=true
A pull request…

https://github.com/gap-system/gap/pull/4248
https://github.com/gap-system/gap/pull/4248/checks
https://github.com/marketplace?type=actions
Questions?

https://docs.github.com/en/actions/learn-github-actions

You might also like