Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitHub Actions for R

Jim Hester
January 29, 2020

GitHub Actions for R

Open source R packages on GitHub often take advantage of continuous integration services to automatically check their packages for errors. This is very useful to catch things quickly, as well and increasing confidence for proposed changes, as the Pull Requests can be checked before they are merged. Travis-CI and Appveyor are the most popular current methods. However a new service, GitHub Actions, shows promise for being more featureful and simpler to configure and debug. This talk demonstrates using this service for R packages and projects and how to configure them for your own use in packages and reports.

Jim Hester

January 29, 2020
Tweet

More Decks by Jim Hester

Other Decks in Programming

Transcript

  1. GitHub
    Actions
    for
    Jim
    Hester

    View full-size slide

  2. Continuous
    Integration
    ensure YOU don't break
    project
    ensure reproducibility!
    Not just for
    R p
    ackages!
    ensure OTHERS don't
    break project

    View full-size slide

  3. Continuous Integration
    "If it hurts, do it more often" - Martin Fowler
    P
    ain
    Time between Actions

    View full-size slide

  4. Continuous Integration
    "If it hurts, do it more often" - Martin Fowler

    View full-size slide

  5. Continuous Integration
    "If it hurts, do it more often" - Martin Fowler

    View full-size slide

  6. Continuous Integration
    "If it hurts, do it more often" - Martin Fowler

    View full-size slide

  7. What?
    How?
    Why?

    View full-size slide

  8. What?
    How?
    Why?
    linux

    View full-size slide

  9. Windows
    What?
    How?
    Why?
    linux

    View full-size slide

  10. Windows
    What?
    How?
    Why?
    macOS
    linux

    View full-size slide

  11. Docker
    Windows
    What?
    How?
    Why?
    macOS
    linux

    View full-size slide

  12. Docker
    Windows
    What?
    How?
    Why?
    macOS
    linux
    20
    Concurrent
    Jobs!
    6 hours per
    job!!!

    View full-size slide

  13. Docker
    Windows
    What?
    How?
    Why?
    macOS
    linux
    20
    Concurrent
    Jobs!
    6 hours per
    job!!!
    Requires sep
    arate setup
    and Authentication???

    View full-size slide

  14. Docker
    Windows
    What?
    How?
    Why?
    macOS
    linux
    20
    Concurrent
    Jobs!
    6 hours per
    job!!!
    Requires sep
    arate setup
    and Authentication???

    View full-size slide

  15. Docker
    Windows
    What?
    How?
    Why?
    Is it free???
    macOS
    linux
    20
    Concurrent
    Jobs!
    6 hours per
    job!!!
    Requires sep
    arate setup
    and Authentication???

    View full-size slide

  16. Docker
    Windows
    What?
    How?
    Why?
    Is it free???
    macOS
    linux
    for open source, academic
    or educational repositories
    20
    Concurrent
    Jobs!
    6 hours per
    job!!!
    Requires sep
    arate setup
    and Authentication???

    View full-size slide

  17. Operating
    Systems
    Concurrent
    builds
    maximum
    job
    Ease of
    setup
    GitHub
    Actions
    20
    360
    minutes

    Travis CI 3
    50
    minutes

    Circle CI 4
    300
    minutes

    Appveyor 1
    60
    minutes

    View full-size slide

  18. Azure Pipelines?

    View full-size slide

  19. Azure Pipelines?
    ++ More mature than GitHub Actions

    View full-size slide

  20. Azure Pipelines?
    ++ More mature than GitHub Actions
    −− Much more challenging to Setup

    View full-size slide

  21. Azure Pipelines?
    ++ More mature than GitHub Actions
    −− Much more challenging to Setup
    GitHub Actions based on
    Azure pipelines

    View full-size slide

  22. What?
    Why?
    How?

    View full-size slide

  23. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  24. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  25. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  26. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  27. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  28. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  29. library(usethis)
    use_github_actions()
    What?
    Why?
    How?

    View full-size slide

  30. library(usethis)
    use_github_actions_tidy()

    View full-size slide

  31. library(usethis)
    use_github_actions_tidy()

    View full-size slide

  32. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Matrix
    builds!

    View full-size slide

  33. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Matrix
    builds!
    Multiple
    OS!

    View full-size slide

  34. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Matrix
    builds!
    Multiple
    OS!
    Multiple R
    Versions!

    View full-size slide

  35. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Matrix
    builds!
    Multiple
    OS!
    RSPM
    linux
    binaries!
    Multiple R
    Versions!

    View full-size slide

  36. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    P
    ackage
    Caching!

    View full-size slide

  37. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Queries and
    inst
    alls System
    Dependencies!

    View full-size slide

  38. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Upload full
    check results!

    View full-size slide

  39. library(usethis)
    use_github_actions_tidy()
    What?
    Why?
    How?
    Record and
    upload code
    coverage!

    View full-size slide

  40. pkgdown
    requires a Personal Access token
    blogdown
    requires a netlify deploy token
    Bookdown
    requires a netlify deploy token
    use_github_action("pkgdown.y
    aml")
    use_github_action("blogdown.y
    aml")
    use_github_action("bookdown.y
    aml")
    github.com/r-lib/actions

    View full-size slide

  41. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")

    View full-size slide

  42. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")

    View full-size slide

  43. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")
    Inst
    all R & p
    andoc

    View full-size slide

  44. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")
    Inst
    all R p
    ackages and hugo

    View full-size slide

  45. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")
    Build the site!

    View full-size slide

  46. blogdown
    requires a netlify deploy token
    use_github_action("blogdown.y
    aml")
    deploy to netlify

    View full-size slide

  47. Render README
    requires a Personal Access token
    Document and style
    Runs on Pull requests when you comment
    with /document or /style
    use_github_action("render-readme.y
    aml")
    use_github_action("pr-commands.y
    aml")
    github.com/r-lib/actions

    View full-size slide

  48. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View full-size slide

  49. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View full-size slide

  50. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View full-size slide

  51. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View full-size slide

  52. github.com/r-lib/actions
    usethis::use_github_actions()
    speakerdeck.com/jimhester/github-actions-for-r
    @jimhester
    @maxheld83
    GitHub Actions for
      @jimhester_
    @maxheld

    View full-size slide