forked from prisma/tiberius
-
Notifications
You must be signed in to change notification settings - Fork 0
Fixed the pipelines #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JLesDev
wants to merge
30
commits into
main
Choose a base branch
from
fixed-the-pipelines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
232fe82
Fixed pipelines
JLesDev 55b1798
Xtask work
JLesDev a733304
macos test --lib + clippy
JLesDev 0905769
Cargo clippy
JLesDev 35d431c
Clean up
JLesDev d79bf69
Clean up
JLesDev 71900c7
Fixes based on comments
JLesDev 9cf0f78
Testing
JLesDev a5d1d0f
Added working directory
JLesDev d833a01
Added working directory
JLesDev 82ddf82
Added working directory
JLesDev 9ee8f39
Added working directory
JLesDev 8944a3d
Fixes
JLesDev 1be487e
Making it better
JLesDev 07fffb2
Making it better
JLesDev 34c1d39
Certificate fixes
JLesDev 39d0ede
Certificate fixes - testing
JLesDev 692c114
Certificate fixes - testing
JLesDev 1de4b02
Certificate fixes - testing
JLesDev 16ff2b8
Certificate fixes - testing
JLesDev 9cb967f
Certificate fixes - testing
JLesDev 6659073
Certificate fixes - testing
JLesDev bcf7876
Certificate fixes - testing
JLesDev a6c8ae6
Certificate fixes - testing
JLesDev 7ab0425
Certificate fixes - testing
JLesDev ad3b79d
update certs generation
esheppa 09440ea
Remove connection string for linux
JLesDev 8cd5391
Remove connection string for linux
JLesDev e56c4d7
Remove connection string for linux
JLesDev ec21ab9
Clean up + instructions
JLesDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [alias] | ||
| xtask = "run --package xtask --" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,217 +1,184 @@ | ||
| name: Cargo tests | ||
| name: Cargo Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| branches: [ main ] | ||
| pull_request: | ||
|
|
||
|
|
||
| jobs: | ||
| clippy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| components: clippy | ||
| override: true | ||
| - name: Install dependencies | ||
| run: sudo apt install -y openssl libkrb5-dev | ||
| - uses: actions-rs/clippy-check@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| args: --features=all | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| - uses: actions/checkout@v5 # checkout versions have been updated. previous v1/2 | ||
| - uses: dtolnay/rust-toolchain@stable # changed to stable | ||
| with: | ||
| components: rustfmt, clippy | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| components: rustfmt | ||
| override: true | ||
| - uses: mbrobbel/rustfmt-check@master | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y libkrb5-dev krb5-user && sudo ln -s /usr/include/krb5/gssapi /usr/include/gssapi | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need |
||
|
|
||
| - run: cargo clippy --features=all | ||
|
|
||
| - run: cargo fmt --check | ||
|
|
||
| cargo-test-linux: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| database: | ||
| - 2017 | ||
| - 2019 | ||
| - 2022 | ||
| - azure-sql-edge | ||
| features: | ||
| - "--features=all" | ||
| - "--no-default-features" | ||
| - "--no-default-features --features=chrono" | ||
| - "--no-default-features --features=time" | ||
| - "--no-default-features --features=rustls" | ||
| - "--no-default-features --features=vendored-openssl" | ||
|
|
||
| engine: [ 2017, 2019, 2022, "azure" ] | ||
esheppa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| env: | ||
| TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=SA;password=<YourStrong@Passw0rd>;TrustServerCertificate=true" | ||
| RUSTFLAGS: "-Dwarnings" | ||
| TIBERIUS_TEST_INSTANCE: "MSSQLSERVER" | ||
| # TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true" | ||
| # TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;IntegratedSecurity=true;TrustServerCertificate=true" | ||
| # TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=sa;password=<YourStrong@Passw0rd>;TrustServerCertificate=true" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y libkrb5-dev krb5-user && sudo ln -s /usr/include/krb5/gssapi /usr/include/gssapi | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - uses: actions-rs/toolchain@v1 | ||
| # we use the same cache key irrespective of the | ||
| # SQL server version | ||
| - name: Setup Cargo build cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: target | ||
| key: ubuntu-cargo | ||
esheppa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: ${{ runner.os }}-cargo-${{ matrix.features }} | ||
| - run: cargo xtask container ${{ matrix.engine }} | ||
|
|
||
| - name: Start SQL Server ${{matrix.database}} | ||
| run: DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml up -d mssql-${{matrix.database}} | ||
| # Wait for SQL Server | ||
| - run: sleep 25 | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt install -y openssl libkrb5-dev | ||
| - run: cargo xtask test --features=all | ||
| - run: cargo xtask test --no-default-features | ||
| - run: cargo xtask test --no-default-features --features=chrono | ||
| - run: cargo xtask test --no-default-features --features=rustls | ||
| - run: cargo xtask test --no-default-features --features=time | ||
| - run: cargo xtask test --no-default-features --features=vendored-openssl | ||
|
|
||
| - name: Run tests | ||
| run: cargo test ${{matrix.features}} | ||
| - run: cargo xtask stop ${{ matrix.engine }} | ||
|
|
||
| cargo-test-windows: | ||
| runs-on: windows-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| database: | ||
| - 2019 | ||
| features: | ||
| - "--features=all" | ||
| - "--no-default-features --features=rustls,winauth" | ||
| - "--no-default-features --features=vendored-openssl,winauth" | ||
|
|
||
| - 2019 | ||
| env: | ||
| TIBERIUS_TEST_INSTANCE: "MSSQLSERVER" | ||
| TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true" | ||
| # TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true" | ||
| TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;IntegratedSecurity=true;TrustServerCertificate=true" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - uses: actions-rs/toolchain@v1 | ||
|
|
||
| - name: Set required PowerShell modules | ||
| id: psmodulecache | ||
| uses: potatoqualitee/psmodulecache@v1 | ||
| with: | ||
| modules-to-cache: SqlServer | ||
|
|
||
| - name: Setup PowerShell module cache | ||
| id: cacher | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: ${{ steps.psmodulecache.outputs.modulepath }} | ||
| key: ${{ steps.psmodulecache.outputs.keygen }} | ||
|
|
||
| - name: Setup Chocolatey download cache | ||
| id: chococache | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey\ | ||
| key: chocolatey-install | ||
|
|
||
| - name: Setup Cargo build cache | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| C:\Users\runneradmin\.cargo\registry | ||
| C:\Users\runneradmin\.cargo\git | ||
| target | ||
| key: ${{ runner.os }}-cargo | ||
|
|
||
| - name: Install required PowerShell modules | ||
| if: steps.cacher.outputs.cache-hit != 'true' | ||
| shell: powershell | ||
| run: | | ||
| Set-PSRepository PSGallery -InstallationPolicy Trusted | ||
| Install-Module SqlServer | ||
|
|
||
| - name: Install SQL Server ${{matrix.database}} | ||
| shell: powershell | ||
| run: | | ||
| choco feature disable --name="'exitOnRebootDetected'" | ||
| $ErrorActionPreference = 'SilentlyContinue' | ||
| choco install sql-server-${{matrix.database}} --params="'/IgnorePendingReboot'" | ||
|
|
||
| - name: Setup SQL Server ${{matrix.database}} | ||
| shell: powershell | ||
| run: | | ||
| Import-Module 'sqlps' | ||
|
|
||
| [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null | ||
| [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null | ||
|
|
||
| $serverName = $env:COMPUTERNAME | ||
| $instanceName = "MSSQLSERVER" | ||
|
|
||
| $smo = 'Microsoft.SqlServer.Management.Smo.' | ||
| $wmi = new-object ($smo + 'Wmi.ManagedComputer') | ||
| $wmi | ||
|
|
||
| # Enable TCP/IP | ||
| echo "Enabling TCP/IP" | ||
| $Tcp = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']") | ||
| $Tcp.IsEnabled = $true | ||
| $Tcp.alter() | ||
| $Tcp | ||
|
|
||
| # Enable named pipes | ||
| echo "Enabling named pipes" | ||
| $Np = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Np']") | ||
| $Np.IsEnabled = $true | ||
| $Np.Alter() | ||
| $Np | ||
|
|
||
| # Set Alias | ||
| echo "Setting the alias" | ||
| New-Item HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client -Name ConnectTo | Out-Null | ||
| Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -Name '(local)' -Value "DBMSSOCN,$serverName\$instanceName" | Out-Null | ||
|
|
||
| # Start services | ||
| echo "Starting services" | ||
| Set-Service SQLBrowser -StartupType Manual | ||
| Start-Service SQLBrowser | ||
| net stop MSSQLSERVER | ||
| net start MSSQLSERVER | ||
|
|
||
| - name: Run normal tests | ||
| shell: powershell | ||
| run: cargo test ${{matrix.features}} | ||
| - uses: actions/checkout@v5 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Set required PowerShell modules | ||
| id: psmodulecache | ||
| uses: potatoqualitee/psmodulecache@v1 | ||
| with: | ||
| modules-to-cache: SqlServer | ||
|
|
||
| - name: Setup PowerShell module cache | ||
| id: cacher | ||
| uses: actions/cache@v4 # cache updated to v4 | ||
| with: | ||
| path: ${{ steps.psmodulecache.outputs.modulepath }} | ||
| key: ${{ steps.psmodulecache.outputs.keygen }} | ||
|
|
||
| - name: Cache Cargo build cache | ||
| uses: actions/cache@v4 # cache command, updated to v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: windows-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Install required PowerShell modules | ||
| if: steps.cacher.outputs.cache-hit != 'true' | ||
| shell: powershell | ||
| run: | | ||
| Set-PSRepository PSGallery -InstallationPolicy Trusted | ||
| Install-Module SqlServer | ||
|
|
||
| - name: Install SQL Server ${{matrix.database}} | ||
| shell: powershell | ||
| run: | | ||
| choco feature disable --name="'exitOnRebootDetected'" | ||
| $ErrorActionPreference = 'SilentlyContinue' | ||
| choco install sql-server-${{matrix.database}} --params="'/IgnorePendingReboot'" | ||
|
|
||
| - name: Setup SQL Server ${{matrix.database}} | ||
| shell: powershell | ||
| run: | | ||
| Import-Module 'sqlps' | ||
| [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null | ||
| [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null | ||
| $serverName = $env:COMPUTERNAME | ||
| $instanceName = "MSSQLSERVER" | ||
| $smo = 'Microsoft.SqlServer.Management.Smo.' | ||
| $wmi = new-object ($smo + 'Wmi.ManagedComputer') | ||
| $wmi | ||
| # Enable TCP/IP | ||
| echo "Enabling TCP/IP" | ||
| $Tcp = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']") | ||
| $Tcp.IsEnabled = $true | ||
| $Tcp.alter() | ||
| $Tcp | ||
| # Enable named pipes | ||
| echo "Enabling named pipes" | ||
| $Np = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Np']") | ||
| $Np.IsEnabled = $true | ||
| $Np.Alter() | ||
| $Np | ||
| # Set Alias | ||
| echo "Setting the alias" | ||
| New-Item HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client -Name ConnectTo | Out-Null | ||
| Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -Name '(local)' -Value "DBMSSOCN,$serverName\$instanceName" | Out-Null | ||
| # Start services | ||
| echo "Starting services" | ||
| Set-Service SQLBrowser -StartupType Manual | ||
| Start-Service SQLBrowser | ||
| net stop MSSQLSERVER | ||
| net start MSSQLSERVER | ||
|
|
||
| - shell: powershell | ||
| run: cargo test --features=all | ||
| - shell: powershell | ||
| run: cargo test --no-default-features --features=rustls,winauth | ||
| - shell: powershell | ||
| run: cargo test --no-default-features --features=vendored-openssl,winauth | ||
|
|
||
| cargo-test-macos: | ||
| runs-on: macos-12 | ||
| runs-on: macos-26 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| database: | ||
| - 2019 | ||
| features: | ||
| - "--no-default-features --features=rustls,chrono,time,tds73,sql-browser-async-std,sql-browser-tokio,sql-browser-smol,integrated-auth-gssapi,rust_decimal,bigdecimal" | ||
| - "--no-default-features --features=vendored-openssl" | ||
|
|
||
| env: | ||
| TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=SA;password=<YourStrong@Passw0rd>;TrustServerCertificate=true" | ||
| - 2019 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - uses: actions-rs/toolchain@v1 | ||
|
|
||
| - uses: docker-practice/actions-setup-docker@master | ||
|
|
||
| - name: Start SQL Server ${{matrix.database}} | ||
| run: DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml up -d mssql-${{matrix.database}} | ||
| - uses: actions/checkout@v5 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
|
|
||
| - name: Run tests | ||
| run: cargo test ${{matrix.features}} | ||
| # For now we're not running the integration tests in macos, | ||
| # only running the unit tests | ||
| - run: cargo test --no-default-features --features=vendored-openssl --lib | ||
| - run: cargo test --no-default-features --features=rustls,chrono,time,tds73,sql-browser-tokio,sql-browser-smol,integrated-auth-gssapi,rust_decimal,bigdecimal --lib | ||
| - run: cargo clippy ${{ matrix.features }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. run this with all the feature sets used with |
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,5 @@ Cargo.lock | |
| .idea | ||
| .direnv/ | ||
| .vscode | ||
| mssql.crt | ||
| mssql.key | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.