Using GitHub Actions to Accelerate your Data Efforts

csv,conf,v6

4 May 2021

Grant R. Vousden-Dishington

About Me

geo

San Diego - Kumeyaay  territory

 

bio

Research Software Engineer @ ADL

(this is not a work-related talk)

 

PhD Dropout circa 2014

Engineering/Neuroscience

 

compsci/philosophy/engineering 2011

github: @grantrvd

twitter: @usethespacebar

email: GrantRVD [at] gmail

What
Is A
GitHub Action?

When a Specified Event Happens, GitHub Will Do the Computation for You

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      - run: npm install -g bats
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

Parts Of A Workflow

name: learn-github-actions

on: [push]

jobs:

  check-bats-version:
  
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
      
      - run: npm install -g bats
      
      - run: bats -v

Events

trigger

Workflows

that are sequences of

Jobs

that contain

Steps

that perform

Runners

executed by

Actions

What Triggers A Workflow?

Manual Events

GitHub Events

on:
  issues:
    types: [opened, edited, milestoned]
on:
  push
on:
  pull_request:
    types: [assigned, opened, synchronize, reopened]
on:
  workflow_dispatch:
    inputs:
      name:
        description: 'Person to greet'
        required: true
        default: 'Mona the Octocat'

Source: Manual Events

Timed Events

on:
  schedule:
    # * is a special character in YAML so you have to quote this string
    - cron:  '30 5,17 * * *'

What Actions Are There?

What Actions Are There?

Some common ones

actions/checkout

for getting your code on the runner

actions/upload-artifact

and 

actions/download-artifact

for passing data/assets between jobs

name: Kitchen Testing Suite

on:
  push:
    branches:
    - main
  
  pull_request:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    
    strategy:
      matrix:
        os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
        python-version: [3.8, 3.9]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install pipenv
      run: pip install pipenv
    - name: Run Tests in pipenv
      run: |
        pipenv install --dev
        pipenv run pytest
      

Example:

Python Testing

Where To Look Next?

Other GitHub Action Data Resources

 

Ritheesh Baradwaj's work

blog

repo

 

Debugging Actions
action-tmate

 

csv,conf,v6 - Github Actions for Data Efforts

By Grant R. Vousden-Dishington

csv,conf,v6 - Github Actions for Data Efforts

Presented at csv,conf,v6 on 4 May 2021

  • 416