Skip to content

#187: stop() -> rlang::abort() #345

#187: stop() -> rlang::abort()

#187: stop() -> rlang::abort() #345

Workflow file for this run

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()