chore: Explicit configuration for read the docs #633
This file contains 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
name: Build and test | |
on: [push, pull_request] | |
jobs: | |
linux: | |
name: Build & Test Linux | |
runs-on: ubuntu-latest | |
services: | |
sqlserver: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
ports: | |
- 1433:1433 | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: My@Test@Password1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install latest rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Install ODBC Drivers | |
run: | | |
# curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
# curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list | |
apt-get update | |
ACCEPT_EULA=Y apt-get install -y msodbcsql18 | |
ln -s /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-18.*.so.* /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.so | |
shell: sudo bash {0} | |
- name: Print odbcinst.ini | |
run: cat /etc/odbcinst.ini | |
# selecting a toolchain either by action or manual `rustup` calls should happen | |
# before the plugin, as the cache uses the current rustc version as its cache key | |
- name: Rust build cache | |
uses: Swatinem/rust-cache@v2 | |
# odbcsv tool is used by the tests to setup tables | |
- name: Install odbcsv | |
run: cargo install odbcsv | |
- name: Test | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install -e .[test] | |
pytest -vv |