Skip to content

Bump NUnit.Analyzers from 4.4.0 to 4.5.0 in /src #2275

Bump NUnit.Analyzers from 4.4.0 to 4.5.0 in /src

Bump NUnit.Analyzers from 4.4.0 to 4.5.0 in /src #2275

Workflow file for this run

name: CI
on:
push:
branches:
- master
- release-*
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
defaults:
run:
shell: pwsh
jobs:
build:
name: ${{ matrix.name }}-${{ matrix.engine }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, ubuntu-22.04]
engine: [SqlServer, MySql, PostgreSql, Oracle]
include:
- os: windows-2022
name: Windows
- os: ubuntu-22.04
name: Linux
fail-fast: false
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build src --configuration Release -graph
- name: Upload packages
if: matrix.name == 'Windows' && matrix.engine == 'SqlServer'
uses: actions/[email protected]
with:
name: NuGet packages
path: nugets/
retention-days: 7
- name: Azure login
uses: azure/[email protected]
if: matrix.engine == 'PostgreSQL' || (matrix.engine == 'Oracle' && matrix.name == 'Windows')
with:
creds: ${{ secrets.AZURE_ACI_CREDENTIALS }}
- name: Setup SQL Server
if: matrix.engine == 'SqlServer'
uses: Particular/[email protected]
with:
connection-string-env-var: SQLServerConnectionString
catalog: nservicebus
extra-params: "Encrypt=False;"
- name: Setup PostgreSql 15.x
if: matrix.engine == 'PostgreSql'
uses: Particular/[email protected]
with:
connection-string-name: PostgreSqlConnectionString
tag: SqlPersistence
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup MySQL
id: setup-mysql
if: matrix.engine == 'MySql'
run: |
echo '[client]
user=root
host=localhost' >> mysql-login
if ($Env:RUNNER_OS -eq 'Windows') {
echo "Installing MySQL from Chocolatey"
choco install mysql --limitoutput
echo 'password=' >> mysql-login
} else {
echo "Starting MySQL service preinstalled on Linux agent"
sudo systemctl start mysql.service
echo 'password=root' >> mysql-login
}
for ($i = 0; $i -lt 30; $i++) { ## 2.5 minute timeout
echo "Checking for MySQL connectivity $($i+1)/30..."
$ignore = mysql --defaults-extra-file=mysql-login -e "show databases;"
if ($?) {
echo "Connection successful"
break;
}
sleep 5
}
echo "Creating nservicebus database"
mysql --defaults-extra-file=mysql-login -D mysql -e "create database if not exists nservicebus ;"
echo "Creating user particular"
mysql --defaults-extra-file=mysql-login -D mysql -e "create user particular identified by 'Welcome1' ;"
echo "Giving user particular access to schema nservicebus"
mysql --defaults-extra-file=mysql-login -D mysql -e "grant all on *.* to particular@'%' ;"
$connectionString = "Data Source=localhost;Initial Catalog=nservicebus;User ID=particular;Password=Welcome1;AllowUserVariables=True;AutoEnlist=false;ConnectionReset=true;Connect Timeout=60"
echo "MySQLConnectionString=$connectionString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Setup Oracle
id: setup-oracle
if: matrix.engine == 'Oracle'
uses: Particular/[email protected]
with:
connection-string-name: OracleConnectionString
init-script: ./.github/workflows/scripts/setup-oracle-database-users-and-permissions.sql
tag: SqlPersistence
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prepare Connection Strings for Oracle
if: matrix.engine == 'Oracle'
run: |
$connectionString = $Env:OracleConnectionString
"OracleConnectionString=$($connectionString.Replace('system', 'particular'))" >> $Env:GITHUB_ENV
"OracleConnectionString_Particular2=$($connectionString.Replace('system', 'particular2'))" >> $Env:GITHUB_ENV
- name: Run tests
uses: Particular/[email protected]