fix: Establish compatibility with upcoming DBI 1.3.0 (#197) #369
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: main | |
| pull_request: | |
| name: check-linux | |
| jobs: | |
| check: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { os: ubuntu-24.04, r: 'oldrel-4' } | |
| - { os: ubuntu-24.04, r: 'oldrel-3' } | |
| - { os: ubuntu-24.04, r: 'oldrel-2' } | |
| - { os: ubuntu-24.04, r: 'oldrel-1' } | |
| - { os: ubuntu-24.04, r: 'release' } | |
| - { os: ubuntu-24.04, r: 'devel', http-user-agent: 'R/4.0.0 (ubuntu-24.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions' } | |
| 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_: false | |
| _R_CHECK_CRAN_INCOMING_REMOTE_: false | |
| RSPM: "https://packagemanager.posit.co/all/__linux__/noble/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 | |
| - uses: r-lib/actions/setup-tinytex@v2 | |
| if: contains(matrix.config.args, 'no-manual') == false | |
| - 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: Set CXX for older R versions (linux) | |
| run: | | |
| # CXX isn't set correctly for older R versions, leading to ODBC to complain about not having a compiler | |
| echo "CXX=$(R CMD config CXX)" >> $GITHUB_ENV | |
| if: contains(runner.os, 'linux') && (matrix.config.r == 'oldrel-3' || matrix.config.r == 'oldrel-4') | |
| - 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, devtools | |
| - name: Setup databases | |
| run: bash db-setup/populate-dbs.sh | |
| env: | |
| PGPASSWORD: ${{ env.DBROOTPASS }} | |
| MYSQL_PWD: ${{ env.DBROOTPASS }} | |
| - name: Check | |
| run: | | |
| # Only error on warnings or above for anything prior to 3.4 | |
| erroron=$(if (( $(echo "${{ matrix.config.r }} < 3.4" | bc -l) )); then echo "warning"; else echo "note"; fi) | |
| Rscript -e "rcmdcheck::rcmdcheck(args = c('--no-manual', '--as-cran'), error_on = '$erroron', check_dir = 'check')" | |
| - name: Upload check results | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
| path: check |