diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml new file mode 100644 index 0000000..2472f74 --- /dev/null +++ b/.github/workflows/r.yml @@ -0,0 +1,56 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# See https://github.com/r-lib/actions/tree/master/examples#readme for +# additional example workflows available for the R community. + +name: R + +on: + push: + branches: [ master ] + pull_request: + branches: [ master, development ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + r-version: [4.0] + + steps: + - uses: actions/checkout@v2 + - name: Install linux libs + run: sudo apt-get install -y libcurl4-openssl-dev + + - name: Set up R ${{ matrix.r-version }} + uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.r-version }} + + - name: Query dependencies + run: | + install.packages("remotes") + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v1 + with: + path: ${{ env.R_LIBS_USER }} + key: ubuntu-r-4-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ubuntu-r-4 + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("covr") + shell: Rscript {0} + + - name: Check + run: covr::codecov() + shell: Rscript {0}