From bc85516ce664e80d5ff7ec9977943742a83b00eb Mon Sep 17 00:00:00 2001 From: Athanasia Monika Mowinckel Date: Fri, 20 Nov 2020 14:31:58 +0100 Subject: [PATCH] fix actions --- .github/workflows/R-CMD-check.yaml | 13 +++++--- .github/workflows/pkgdown.yaml | 48 ++++++++++++++++++++++++++++++ README.Rmd | 1 - README.md | 1 + 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 2142c6e..75f1527 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -3,9 +3,11 @@ on: push: branches: + - main - master pull_request: branches: + - main - master name: R-CMD-check @@ -28,15 +30,16 @@ jobs: env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 with: r-version: ${{ matrix.config.r }} - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v1 - name: Query dependencies run: | @@ -47,7 +50,7 @@ jobs: - name: Cache R packages if: runner.os != 'Windows' - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} @@ -59,7 +62,9 @@ jobs: while read -r cmd do eval sudo $cmd - done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")') + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + sudo apt-get install libudunits2-dev + sudo apt-get install libgdal-dev - name: Install dependencies run: | diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..3c908d3 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + - master + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + install.packages("pkgdown", type = "binary") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' diff --git a/README.Rmd b/README.Rmd index 55b4129..4d7e16b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,6 @@ knitr::opts_chunk$set( out.width = "100%", fig.retina = 3 ) -devtools::load_all(".") ``` # ggsegChen diff --git a/README.md b/README.md index eb47d18..fb2a40f 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ library(ggsegChen) ``` r library(ggseg) +#> Loading required package: ggplot2 plot(chenAr) + labs(title = "Chen areal (chenAr)") +