-
Notifications
You must be signed in to change notification settings - Fork 15
116 lines (93 loc) · 3.55 KB
/
check-macOS.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
on:
push:
branches: main
pull_request:
name: check-macOS
jobs:
check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- { os: macOS-latest, r: 'release' }
- { os: macOS-latest, r: 'oldrel-1' }
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
DBROOTPASS: r2N5y7V*
DITTODB_ENABLE_PG_TESTS: true
DITTODB_ENABLE_MARIA_TESTS: true
ODBCSYSINI: /usr/local/etc/
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
if: contains(matrix.config.args, 'no-manual') == false
- name: Install databases (macOS)
run: |
brew update || brew update
bash db-setup/postgres-brew.sh
bash db-setup/mariadb-brew.sh
if: contains(runner.os, 'macOS')
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: remotes, rcmdcheck, httptest, devtools, lintr
- name: Setup databases
run: bash db-setup/populate-dbs.sh
env:
PGPASSWORD: ${{ env.DBROOTPASS }}
MYSQL_PWD: ${{ env.DBROOTPASS }}
- name: Build RMariaDB from source (oldrel only)
# This shouldn't be necessary, but in the 4.2 runners on GitHub with the
# binary the results from the database come back as numbers and not strings.
shell: Rscript {0}
if: contains(matrix.config.r, 'oldrel')
run: |
install.packages("RMariaDB", type = "source")
- name: Check
shell: Rscript {0}
run: |
rcmdcheck::rcmdcheck(args = '${{ matrix.config.args }}', error_on = 'note', check_dir = 'check')
- name: Upload check results
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: "devtools::test() check"
run: |
R CMD INSTALL .
# wipe databases
psql -h 127.0.0.1 -U postgres -f db-setup/postgres-reset.sql
mysql -h 127.0.0.1 -u root -e "source db-setup/mariadb-reset.sql"
# restore
psql -h 127.0.0.1 -U postgres -d nycflights -f db-setup/postgres-nycflights.sql
mysql -h 127.0.0.1 -u root -e "source db-setup/mariadb-nycflights.sql"
Rscript -e 'devtools::test(stop_on_failure = TRUE)'
env:
PGPASSWORD: ${{ env.DBROOTPASS }}
MYSQL_PWD: ${{ env.DBROOTPASS }}
- name: Test coverage
if: contains(matrix.config.r, 'release')
run: |
# wipe databases
psql -h 127.0.0.1 -U postgres -f db-setup/postgres-reset.sql
mysql -h 127.0.0.1 -u root -e "source db-setup/mariadb-reset.sql"
# restore
psql -h 127.0.0.1 -U postgres -d nycflights -f db-setup/postgres-nycflights.sql
mysql -h 127.0.0.1 -u root -e "source db-setup/mariadb-nycflights.sql"
# coverage
Rscript -e 'remotes::install_github("r-lib/covr@gh-actions")'
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
env:
PGPASSWORD: ${{ env.DBROOTPASS }}
MYSQL_PWD: ${{ env.DBROOTPASS }}
- name: linting
if: contains(matrix.config.r, 'release')
shell: Rscript {0}
run: lintr::lint_package()