Release 0.6.59 #559
Workflow file for this run
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
| name: SQLx | |
| on: | |
| pull_request: | |
| merge_group: | |
| types: [checks_requested] | |
| push: | |
| branches: | |
| - main | |
| # Tests and the ODBC DSN use these fixed ports; local Compose runs use random ports. | |
| env: | |
| SQLX_POSTGRES_PORT: "5432" | |
| SQLX_MYSQL_PORT: "3306" | |
| SQLX_MSSQL_PORT: "1433" | |
| jobs: | |
| format: | |
| name: Format | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - run: cargo fmt --all -- --check | |
| check: | |
| name: Check | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| tls: [native-tls, rustls] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| save-if: ${{ false }} | |
| - name: Run clippy for core with all features | |
| run: | | |
| cargo clippy --locked --manifest-path sqlx-core/Cargo.toml \ | |
| --no-default-features \ | |
| --features offline,all-databases,all-types,migrate,${{ matrix.tls }} \ | |
| -- -D warnings | |
| - name: Run clippy for root with all features | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features offline,all-databases,all-types,migrate,${{ matrix.tls }},macros \ | |
| -- -D warnings | |
| - name: Run clippy for all targets | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --all-targets \ | |
| --features offline,all-databases,all-types,migrate,${{ matrix.tls }} \ | |
| -- -D warnings | |
| test: | |
| name: Unit Test ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-2025-vs2026] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| save-if: ${{ false }} | |
| - run: sudo apt-get update && sudo apt-get install -y libodbc2 unixodbc-dev | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| - run: cargo test --locked | |
| --manifest-path sqlx-core/Cargo.toml | |
| --features offline,all-databases,all-types,rustls | |
| cli: | |
| name: CLI Binaries | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-2025-vs2026] #, macOS-latest] | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| args: --features openssl-vendored | |
| bin: target/debug/cargo-sqlx | |
| - os: windows-2025-vs2026 | |
| target: x86_64-pc-windows-msvc | |
| bin: target/debug/cargo-sqlx.exe | |
| # FIXME: macOS build fails because of missing pin-project-internal | |
| # - os: macOS-latest | |
| # target: x86_64-apple-darwin | |
| # bin: target/debug/cargo-sqlx | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: cargo build --locked | |
| --manifest-path sqlx-cli/Cargo.toml | |
| --bin cargo-sqlx | |
| ${{ matrix.args }} | |
| - name: Smoke-test CLI binary | |
| run: ./${{ matrix.bin }} sqlx --version | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: cargo-sqlx-${{ matrix.target }} | |
| path: ${{ matrix.bin }} | |
| if-no-files-found: error | |
| sqlite: | |
| name: SQLite | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| tls: [native-tls, rustls] | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - run: mkdir /tmp/sqlite3-lib && wget -O /tmp/sqlite3-lib/ipaddr.so https://github.com/nalgeon/sqlean/releases/download/0.15.2/ipaddr.so | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: sqlite-${{ matrix.tls }} | |
| save-if: ${{ github.ref == 'refs/heads/main' && matrix.tls == 'native-tls' }} | |
| - name: Run clippy for sqlite | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features sqlite,all-types,${{ matrix.tls }},macros,migrate \ | |
| -- -D warnings | |
| - run: cargo test --locked | |
| --no-default-features | |
| --features any,macros,migrate,sqlite,all-types,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: sqlite://tests/sqlite/sqlite.db | |
| RUSTFLAGS: --cfg sqlite_ipaddr | |
| LD_LIBRARY_PATH: /tmp/sqlite3-lib | |
| postgres: | |
| name: Postgres | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| postgres: [14, 10] | |
| tls: [native-tls, rustls] | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: postgres-${{ matrix.tls }} | |
| save-if: ${{ github.ref == 'refs/heads/main' && matrix.postgres == '14' }} | |
| - run: | | |
| cargo build --locked --features postgres,all-types,${{ matrix.tls }} | |
| env: | |
| # FIXME: needed to disable `ltree` tests in Postgres 9.6 | |
| # but `PgLTree` should just fall back to text format | |
| RUSTFLAGS: --cfg postgres_${{ matrix.postgres }} | |
| - name: Run clippy for postgres | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features postgres,all-types,${{ matrix.tls }},macros,migrate \ | |
| -- -D warnings | |
| env: | |
| RUSTFLAGS: --cfg postgres_${{ matrix.postgres }} | |
| - run: | | |
| docker compose -f tests/docker-compose.yml up --wait --wait-timeout 120 postgres_${{ matrix.postgres }} | |
| - run: | | |
| cargo test --locked --no-default-features --features any,postgres,macros,all-types,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx | |
| # FIXME: needed to disable `ltree` tests in Postgres 9.6 | |
| # but `PgLTree` should just fall back to text format | |
| RUSTFLAGS: --cfg postgres_${{ matrix.postgres }} | |
| - run: | | |
| cargo test --locked --no-default-features --features any,postgres,macros,migrate,all-types,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=./tests/certs/ca.crt | |
| # FIXME: needed to disable `ltree` tests in Postgres 9.6 | |
| # but `PgLTree` should just fall back to text format | |
| RUSTFLAGS: --cfg postgres_${{ matrix.postgres }} | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 | |
| postgres_ssl_client_cert: | |
| name: Postgres with SSL client cert | |
| runs-on: ubuntu-24.04 | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: postgres-rustls | |
| save-if: ${{ false }} | |
| - run: docker compose up --wait --wait-timeout 120 postgres_16 | |
| working-directory: tests | |
| - run: cargo test --locked --no-default-features --features any,postgres,macros,all-types,rustls | |
| env: | |
| DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=./tests/certs/ca.crt&sslcert=./tests/certs/client.crt&sslkey=./tests/keys/client.key | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 | |
| mysql: | |
| name: MySQL | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| mysql: [8, 5_7] | |
| tls: [native-tls, rustls] | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: mysql-${{ matrix.tls }} | |
| save-if: ${{ github.ref == 'refs/heads/main' && matrix.mysql == '8' }} | |
| - run: | | |
| cargo build --locked --features mysql,all-types,${{ matrix.tls }} | |
| - name: Run clippy for mysql | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features mysql,all-types,${{ matrix.tls }},macros,migrate \ | |
| -- -D warnings | |
| - run: docker compose -f tests/docker-compose.yml up --wait --wait-timeout 120 mysql_${{ matrix.mysql }} | |
| - run: | | |
| cargo test --locked --no-default-features --features any,mysql,macros,migrate,all-types,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled | |
| # MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS. | |
| - run: | | |
| cargo test --locked --no-default-features --features any,mysql,macros,migrate,all-types,${{ matrix.tls }} | |
| if: ${{ !(matrix.mysql == '5_7' && matrix.tls == 'rustls') }} | |
| env: | |
| DATABASE_URL: mysql://root:password@localhost:3306/sqlx | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 | |
| mariadb: | |
| name: MariaDB | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| mariadb: [10_6, 10_3] | |
| tls: [native-tls, rustls] | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: mariadb-${{ matrix.tls }} | |
| save-if: ${{ github.ref == 'refs/heads/main' && matrix.mariadb == '10_6' }} | |
| - run: | | |
| cargo build --locked --features mysql,${{ matrix.tls }} | |
| - name: Run clippy for mariadb | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features mysql,${{ matrix.tls }},macros,migrate \ | |
| -- -D warnings | |
| - run: docker compose -f tests/docker-compose.yml up --wait --wait-timeout 120 mariadb_${{ matrix.mariadb }} | |
| - run: | | |
| cargo test --locked --no-default-features --features any,mysql,macros,migrate,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: mysql://root:password@localhost:3306/sqlx | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 | |
| mssql: | |
| name: MSSQL | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| mssql: [2019, 2022] | |
| tls: [native-tls, rustls] | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: mssql-${{ matrix.tls }} | |
| save-if: ${{ github.ref == 'refs/heads/main' && matrix.mssql == '2022' }} | |
| - run: | | |
| cargo build --locked --features mssql,all-types,${{ matrix.tls }} | |
| - name: Run clippy for mssql | |
| run: | | |
| cargo clippy --locked \ | |
| --no-default-features \ | |
| --features mssql,all-types,${{ matrix.tls }},macros,migrate \ | |
| -- -D warnings | |
| - run: docker compose -f tests/docker-compose.yml up --wait --wait-timeout 120 mssql_${{ matrix.mssql }} | |
| - run: | | |
| cargo test --locked --no-default-features --features any,mssql,macros,migrate,all-types,${{ matrix.tls }} | |
| env: | |
| DATABASE_URL: mssql://sa:Password123!@localhost/sqlx | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 | |
| odbc: | |
| name: ODBC (PostgreSQL and SQLite) | |
| runs-on: ubuntu-24.04 | |
| needs: check | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pinned Rust toolchain | |
| run: rustc --version --verbose | |
| - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 | |
| with: | |
| prefix-key: v1-sqlx | |
| shared-key: odbc | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Start Postgres (no SSL) | |
| run: | | |
| docker compose -f tests/docker-compose.yml up --wait --wait-timeout 120 postgres_16_no_ssl | |
| - name: Install unixODBC and ODBC drivers (PostgreSQL, SQLite) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y unixodbc odbcinst unixodbc-common libodbcinst2 odbc-postgresql libsqliteodbc libodbc2 unixodbc-dev | |
| odbcinst -j | |
| - name: Configure system/user DSN for PostgreSQL | |
| run: | | |
| cp tests/odbc.ini ~/.odbc.ini | |
| odbcinst -q -s || true | |
| echo "select 1;" | isql -v SQLX_PG_5432 || true | |
| - name: Run ODBC tests (PostgreSQL DSN) | |
| run: cargo test --locked --no-default-features --features any,odbc,macros,all-types,rustls | |
| env: | |
| DATABASE_URL: DSN=SQLX_PG_5432;UID=postgres;PWD=password | |
| - name: Run ODBC tests (SQLite driver) | |
| run: cargo test --locked --no-default-features --features any,odbc,macros,all-types,rustls | |
| env: | |
| DATABASE_URL: Driver={SQLite3};Database=./tests/odbc/sqlite.db | |
| - name: Show database logs on failure | |
| if: failure() | |
| run: docker compose -f tests/docker-compose.yml logs --tail 100 |