-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (49 loc) · 1.5 KB
/
codecov.yaml
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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: R Package CI
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1 # You can change this to the R version you need
- name: Cache C++ and R dependencies
uses: actions/cache@v2
with:
path: |
~/.cache/R
~/.local/share/R
key: dependencies-${{ runner.os }}-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: |
dependencies-${{ runner.os }}-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudunits2-dev libgdal-dev
- name: Install dependencies
run: |
R -e 'install.packages("remotes")'
R -e 'remotes::install_deps()'
- name: Install dependencies for covr and testthat
run: R -e 'install.packages(c("covr", "testthat"), dependencies = TRUE)'
- name: Run tests and calculate coverage
run: |
echo "Current working directory: $(pwd)"
R -e 'library(covr); covr::package_coverage(coverage_file = "coverage.xml")'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
coverage_reports: ${{ github.workspace }}/coverage.xml
- name: Cleanup
run: |
R -e 'remove.packages("remotes")'