01-Hello World! #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' This is a super basic action that runs on "workflow_dispatch" (i.e. a button | |
#' you can click on GitHub). It runs on an ubuntu linux virtual machine and | |
#' starts by checking out the repository from GitHub. It then installs R. | |
#' Then, it runs R code to install the `cowsay` package. Then it runs an R script. | |
on: | |
workflow_dispatch | |
name: "Hello World!" | |
jobs: | |
hello-world: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
##### You can ignore this---it isn't something you'd ordinarily need to do ##### | |
- name: Remove .Rprofile #This file will be important for other examples, but not this one | |
run: 'rm .Rprofile' | |
################################################################################ | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 #installs R | |
# the `Rscript` shell command runs an R script. With the `-e` flag it runs an R expression | |
- name: Install R packages | |
run: | | |
Rscript -e "install.packages('cowsay')" | |
- name: Say Hello | |
run: | | |
Rscript R/hello.R |