Skip to content

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

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

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

on:
push:
branches: main
pull_request:
name: check-linux-testthat-2e-3e
jobs:
check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }}, testthat ${{ matrix.config.testhat_e }}e)
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-22.04, r: 'release', testhat_e: '2' }
- { os: ubuntu-22.04, r: 'release', testhat_e: '3' }
env:
CRAN: ${{ matrix.config.cran }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
DBROOTPASS: r2N5y7V*
DITTODB_ENABLE_PG_TESTS: true
DITTODB_ENABLE_MARIA_TESTS: true
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_CRAN_INCOMING_: false
RSPM: "https://packagemanager.rstudio.com/all/__linux__/focal/latest"
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
- uses: r-lib/actions/setup-pandoc@v2
- name: Cache R packages
uses: actions/cache@v3
id: rlibcache
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }}-testthat-editions
- name: Install dependencies (linux)
run: |
sudo apt install unixodbc unixodbc-dev --install-suggests
sudo apt install libcurl4-openssl-dev libmariadb-dev postgresql-client libpq-dev odbc-postgresql
if: contains(runner.os, 'linux')
- name: Install databases and odbc manual adjustments (linux)
run: |
bash db-setup/postgres-docker-container-only.sh
sudo service mysql stop
bash db-setup/mariadb-docker-container-only.sh
# the driver as installed in odbcinst.ini isn't located
sudo sed -i 's/Driver=psqlodbcw.so/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbcw.so/g' /etc/odbcinst.ini
sudo sed -i 's/Driver=psqlodbca.so/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbca.so/g' /etc/odbcinst.ini
# mysql needs time to boot, try it every 5 seconds for 1 minute
n=0
until [ $n -ge 12 ]
do
mysql -h 127.0.0.1 -u root -p${{ env.DBROOTPASS }} -e "SHOW DATABASES" && break
sleep 5
n=$[$n+1]
done
if: contains(runner.os, 'linux')
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck, httptest
- name: Set the testthat edition
run: |
Rscript -e "desc::desc_set('Config/testthat/edition' = '${{ matrix.config.testhat_e }}', file = 'DESCRIPTION')"
- name: Setup databases
run: bash db-setup/populate-dbs.sh
env:
PGPASSWORD: ${{ env.DBROOTPASS }}
MYSQL_PWD: ${{ env.DBROOTPASS }}
- name: Check
shell: Rscript {0}
run: rcmdcheck::rcmdcheck(args = c('--no-manual', '--as-cran'), error_on = 'note', check_dir = 'check')
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check