-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.34 KB
/
unittest.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
name: Unit Tests
on:
push:
branches:
- main
- develop
pull_request:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Before Install
run: |
export CONTAINER=$(docker run \
--env CODECOV_TOKEN=${CODECOV_TOKEN} \
-d paneldata/soep-plots tail -f /dev/null)
docker cp DESCRIPTION ${CONTAINER}:/opt/soep-plots/
docker cp NAMESPACE ${CONTAINER}:/opt/soep-plots/
docker cp R ${CONTAINER}:/opt/soep-plots/
docker cp tests ${CONTAINER}:/opt/soep-plots/
echo "CONTAINER=${CONTAINER}" >> $GITHUB_ENV
- name: Install
run: |
docker exec ${CONTAINER} Rscript -e 'install.packages("remotes")'
docker exec ${CONTAINER} Rscript -e 'remotes::install_github("rstudio/renv")'
docker exec ${CONTAINER} Rscript -e 'renv::restore(packages = "renv")'
docker exec ${CONTAINER} Rscript -e 'devtools::install(upgrade="always")'
docker exec ${CONTAINER} Rscript -e 'devtools::install(upgrade="always", dependencies="Suggests")'
- name: Test
run: docker exec ${CONTAINER} Rscript -e "devtools::test()"
- name: coverage
run: docker exec ${CONTAINER} Rscript -e "library(covr); codecov()"