-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (83 loc) · 2.64 KB
/
test-coverage.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
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
94
95
96
97
98
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
pull_request:
branches: main
name: test-coverage
jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::covr
any::devtools
needs: coverage
- name: Cache Spark
id: cache-spark
uses: actions/cache@v2
with:
path: /home/runner/spark/spark-3.4.1-bin-hadoop3
key: sparklyr-spark-3.4.1-bin-hadoop3-1
- name: Install Spark (via sparklyr)
if: steps.cache-spark.outputs.cache-hit != 'true'
run: |
sparklyr::spark_install(version = "3.4.1")
shell: Rscript {0}
- name: Cache Scala
id: cache-scala
uses: actions/cache@v2
with:
path: /home/runner/scala/
key: scala-2
- name: Install Scala (via sparklyr)
if: steps.cache-scala.outputs.cache-hit != 'true'
run: |
sparklyr::download_scalac()
shell: Rscript {0}
- name: Cache Environment
id: cache-venv
uses: actions/cache@v3
with:
path: /home/runner/.virtualenvs/r-sparklyr-pyspark-3.4
key: sparklyr-virtualenv-3.4
- name: Virtual Environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
devtools::load_all()
install_pyspark("3.4", python = Sys.which("python"))
shell: Rscript {0}
- name: Test coverage
run: |
Sys.setenv("CODE_COVERAGE" = "true")
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}
- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package