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 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  7. What?
    How?
    Why?

    View Slide

  8. What?
    How?
    Why?
    linux

    View Slide

  9. Windows
    What?
    How?
    Why?
    linux

    View Slide

  10. Windows
    What?
    How?
    Why?
    macOS
    linux

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 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 Slide

  18. Azure Pipelines?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  22. What?
    Why?
    How?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  30. library(usethis)
    use_github_actions_tidy()

    View Slide

  31. library(usethis)
    use_github_actions_tidy()

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

  48. View Slide

  49. View Slide

  50. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View Slide

  51. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View Slide

  52. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View Slide

  53. Docker cont
    ainers
    Any docker hub cont
    ainer!

    View Slide

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

    View Slide