-
Notifications
You must be signed in to change notification settings - Fork 32
93 lines (79 loc) · 3.62 KB
/
r.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: R
on:
pull_request:
branches:
- "*"
push:
branches:
- "master"
- "*"
env:
cache-version: 'cache-v1'
jobs:
build:
strategy:
max-parallel: 5
matrix:
config:
- { r-version: release, os: ubuntu-latest}
- { r-version: release, os: macos-latest}
runs-on: ${{ matrix.config.os }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
NOT_CRAN: true
TZ: UTC
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Install ubuntu system dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get install git libcurl4-openssl-dev libssl-dev libicu-dev libxml2-dev make pandoc libgit2-dev libharfbuzz-dev libfribidi-dev
- name: Install macOS system dependencies
if: matrix.config.os == 'macos-latest'
run: |
brew install cairo pkg-config autoconf automake libtool
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r-version}}
- name: Setup r-lib/remotes
run: |
install.packages(c("remotes", "devtools"))
shell: Rscript {0}
- id: bioc
name: Check bioc version
run: |
echo "##[set-output name=mainbiocversion;]$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')"
echo "##[set-output name=subbiocversion;]$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $2}')"
echo "##[set-output name=biocversion;]$(Rscript -e 'cat(as.character(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')"
shell: bash -l {0}
- name: Cache ubuntu R packages
if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os == 'ubuntu-latest'"
uses: actions/cache@v2
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.bioc.outputs.mainbiocversion}}_${{ steps.bioc.outputs.subbiocversion}}-r-${{ matrix.config.r-version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.bioc.outputs.mainbiocversion}}_${{ steps.bioc.outputs.subbiocversion}}-r-${{ matrix.config.r-version}}-
- name: Cache macOS R packages
if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os != 'ubuntu-latest'"
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.bioc.outputs.mainbiocversion}}_${{ steps.bioc.outputs.subbiocversion}}-r-${{ matrix.config.r-version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.bioc.outputs.mainbiocversion}}_${{ steps.bioc.outputs.subbiocversion}}-r-${{ matrix.config.r-version}}-
- name: Install dependencies
run: |
install.packages(c("rcmdcheck", "covr"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Check
run: |
Rscript -e 'rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")'
shell: bash -l {0}
- name: Test coverage
run: |
Rscript -e 'covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}")'
shell: bash -l {0}