Skip to content

Commit

Permalink
CI: Update workflows for ubuntu 24.04 ( now latest ) (#876)
Browse files Browse the repository at this point in the history
* ci: fix MariaDB driver installation failure for NOBLE

Also update packagemanager URL

* ci: fix oracle driver for NOBLE

* ci: fix sql server driver for NOBLE

* ci: add driver manager to other workflows

* ci: sql server connection encryption

https://learn.microsoft.com/en-us/sql/connect/odbc/connection-troubleshooting?view=sql-server-ver16#certificate-chain-errors

* ci: db: update to testing against sql server 2019

* ci: db: fixup: update to testing against sql server 2019

* ci: define ODBCSYSINI in workflows other than db
  • Loading branch information
detule authored Jan 10, 2025
1 parent 15ab298 commit b4f3ad6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/odbc/install-oracle-driver.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sudo apt-get install -y libaio-dev
sudo ln -s /lib/x86_64-linux-gnu/libaio.so /lib/x86_64-linux-gnu/libaio.so.1
mkdir -p /opt/oracle
wget --quiet -O /opt/oracle/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip
wget --quiet -O /opt/oracle/instantclient-odbc-linux.x64-21.12.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-odbc-linux.x64-21.12.0.0.0dbru.zip
Expand Down
5 changes: 3 additions & 2 deletions .github/odbc/odbc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ Database = /tmp/test
Timeout = 2000

[MicrosoftSQLServer]
Driver = ODBC Driver 17 for SQL Server
Server = localhost
Driver = ODBC Driver 18 for SQL Server
Server = 127.0.0.1
Port = 1433
Encrypt = no

[ProMicrosoftSQLServer]
Driver = /home/runner/work/odbc/odbc/.github/odbc/pro_drivers/sql_server/bin/lib/libsqlserverodbc_sb64.so
Expand Down
6 changes: 3 additions & 3 deletions .github/odbc/odbcinst.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Threading=2
[SQLite Driver]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.so
[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.so
UsageCount=1

[Oracle 21 ODBC driver]
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
ODBCSYSINI: ${{ github.workspace }}/.github/odbc

steps:
- uses: actions/checkout@v4
Expand All @@ -52,15 +53,20 @@ jobs:
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install Driver Manager (Ubuntu)
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt-get install -y unixodbc-dev

- name: Install Driver Manager (MacOS)
if: matrix.config.os == 'macOS-latest'
# unixODBC is not pre-installed on macos-14-arm64 runner (#794)
run: brew install unixodbc

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- name: Install unixODBC
if: matrix.config.os == 'macOS-latest'
# unixODBC is not pre-installed on macos-14-arm64 runner (#794)
run: brew install unixodbc

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/db-pro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:

- uses: r-lib/actions/setup-r@v2

- name: Install Driver Manager
run: sudo apt-get install -y unixodbc-dev

- name: Install MySQL Driver
run: |
sudo systemctl start mysql.service
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ jobs:
POSTGRES_DB: test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
sqlserver:
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password12

env:
CRAN: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"
CRAN: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"
ODBCSYSINI: ${{ github.workspace }}/.github/odbc
TNS_ADMIN: ${{ github.workspace }}/.github/odbc
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -58,6 +58,9 @@ jobs:

- uses: r-lib/actions/setup-r@v2

- name: Install Driver Manager
run: sudo apt-get install -y unixodbc-dev

- name: Install MySQL Driver
run: |
sudo systemctl start mysql.service
Expand All @@ -79,11 +82,12 @@ jobs:
run: |
echo "ODBC_CS_SQLSERVER=dsn=MicrosoftSQLServer;UID=SA;PWD=Password12" >> $GITHUB_ENV
sudo bash -c "
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
rm -f /usr/share/keyrings/microsoft-prod.gpg \
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --batch --dearmor --no-tty -o /usr/share/keyrings/microsoft-prod.gpg \
&& curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | tee /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
&& ln -s /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.*.so.* /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.so"
&& ACCEPT_EULA=Y apt-get install -y msodbcsql18 \
&& ln -s /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.*.so.* /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.so"
- name: Install Oracle Driver
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ODBCSYSINI: ${{ github.workspace }}/.github/odbc

steps:
- uses: actions/checkout@v4
Expand All @@ -23,6 +24,9 @@ jobs:
with:
use-public-rspm: true

- name: Install Driver Manager
run: sudo apt-get install -y unixodbc-dev

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
Expand Down

0 comments on commit b4f3ad6

Please sign in to comment.