Skip to content

Fix dispose not being invoked #3629

Fix dispose not being invoked

Fix dispose not being invoked #3629

Workflow file for this run

name: CI
on:
push:
branches:
- master
- release-*
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
build:
name: ${{ matrix.os-name }}-${{ matrix.test-category }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, ubuntu-22.04]
test-category: [ Default, SqlServer, AzureServiceBus, RabbitMQ, AzureStorageQueues, MSMQ, SQS, PrimaryRavenAcceptance, PrimaryRavenPersistence ]
include:
- os: windows-2022
os-name: Windows
- os: ubuntu-22.04
os-name: Linux
exclude:
- os: ubuntu-22.04
test-category: MSMQ
fail-fast: false
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: |
8.0.x
7.0.x
- name: Download RavenDB Server
shell: pwsh
run: ./tools/download-ravendb-server.ps1
- name: Restore
run: dotnet restore src
- name: Build
run: dotnet build src --configuration Release -graph --no-restore
- name: Zip PowerShell module
shell: pwsh
run: |
New-Item assets\PowerShellModules -ItemType Directory
Compress-Archive -Path deploy\PowerShellModules\Particular.ServiceControl.Management\* -DestinationPath assets\PowerShellModules\Particular.ServiceControl.Management.zip
- name: Upload assets
uses: actions/upload-artifact@v4.3.1
if: matrix.test-category == 'Default'
with:
name: ${{ matrix.os-name }}-assets
path: |
nugets/
zip/
assets/
retention-days: 1
- name: Smoke test PowerShell module import
if: matrix.os-name == 'Windows'
shell: pwsh
run: Import-Module ./deploy/PowerShellModules/Particular.ServiceControl.Management
- name: Azure login
uses: azure/login@v1.6.1
if: matrix.test-category == 'AzureServiceBus' || matrix.test-category == 'AzureStorageQueues' || matrix.test-category == 'RabbitMQ'
with:
creds: ${{ secrets.AZURE_ACI_CREDENTIALS }}
- name: Setup SQL Server
uses: Particular/install-sql-server-action@v1.0.2
if: matrix.test-category == 'SqlServer'
with:
connection-string-env-var: ServiceControl_TransportTests_SQL_ConnectionString
catalog: nservicebus
- name: Setup RabbitMQ
uses: Particular/setup-rabbitmq-action@v1.5.0
if: matrix.test-category == 'RabbitMQ'
with:
connection-string-name: ServiceControl_TransportTests_RabbitMQ_ConnectionString
tag: ServiceControl
- name: Setup Azure Service Bus
uses: Particular/setup-azureservicebus-action@v1.3.0
if: matrix.test-category == 'AzureServiceBus'
with:
connection-string-name: ServiceControl_TransportTests_ASBS_ConnectionString
tag: ServiceControl
- name: Setup Azure Storage Queues
uses: Particular/setup-azurestorage-action@v1.2.0
if: matrix.test-category == 'AzureStorageQueues'
with:
connection-string-name: ServiceControl_TransportTests_ASQ_ConnectionString
tag: ServiceControl
- name: Setup SQS environment variables
if: matrix.test-category == 'SQS'
shell: pwsh
run: |
echo "AWS_REGION=${{ secrets.AWS_REGION }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
# Cleanup of queues starting with `GHA-` handled by https://github.com/Particular/NServiceBus.AmazonSQS/blob/master/.github/workflows/tests-cleanup.yml
$connectString = "AccessKeyId=${{ secrets.AWS_ACCESS_KEY_ID }};SecretAccessKey=${{ secrets.AWS_SECRET_ACCESS_KEY }};Region=${{ secrets.AWS_REGION }};QueueNamePrefix=GHA-${{ github.run_id }}"
echo "ServiceControl_TransportTests_SQS_ConnectionString=$connectString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Run tests
uses: Particular/run-tests-action@v1.7.0
env:
ServiceControl_TESTS_FILTER: ${{ matrix.test-category }}
ServiceControl_LicenseText: ${{ secrets.LICENSETEXT }}
ServiceControl_Audit_LicenseText: ${{ secrets.LICENSETEXT }}
Monitoring_LicenseText: ${{ secrets.LICENSETEXT }}