<commit_before># ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master
- building

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'
  Version.Major: 9
  Version.Minor: 0
  Version.MajorMinor: $(Version.Major).$(Version.Minor)
  Version.Revision: $[counter(variables['Version.MajorMinor'], 0)]

steps:
- script: sudo service mysql stop
  displayName: service mysql stop

- task: AWSShellScript@1
  inputs:
    awsCredentials: 'Brighter SNS Tests'
    regionName: 'eu-west-2'
    scriptType: 'inline'
    inlineScript: |
      aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
      aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
      aws configure set region eu-west-2
    failOnStandardError: true

- task: AWSCLI@1
  inputs:
    awsCredentials: 'Brighter SNS Tests'
    regionName: 'eu-west-2'
    awsCommand: 'configure'
    awsSubCommand: 'list'
    awsArguments: '--profile default'
    

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      Write-Host "Version.Major: $(Version.Major)"
      Write-Host "Version.Minor: $(Version.Minor)"
      Write-Host "Version.MajorMinor: $(Version.MajorMinor)"
      Write-Host "Version.Revision: $(Version.Revision)"
      Write-Host "semver build: $(Version.MajorMinor).$(Version.Revision)"

      $xml = [xml](Get-Content -Path src/Directory.Build.props)
      $xml.Project.PropertyGroup.AssemblyVersion = "$(Version.Major).0.0.0"
      $xml.Project.PropertyGroup.FileVersion = "$(Version.MajorMinor).$(Version.Revision).0"
      $xml.Project.PropertyGroup.InformationalVersion = "$(Version.MajorMinor).$(Version.Revision)"
      $xml.Project.PropertyGroup.Version = "$(Version.MajorMinor).$(Version.Revision)"
      $xml.Save("src/Directory.Build.props")

      Get-Content -Path ./src/Directory.Build.props
    pwsh: true

- task: DotNetCoreCLI@2
  displayName: 'dotnet build $(buildConfiguration)'
  inputs:
    command: 'build'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Core tests - dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests/Paramore.Brighter.Core.Tests/Paramore.Brighter.Core.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Fast tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'NoOpStore dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.NoOpStore.Tests\Paramore.Brighter.NoOpStore.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'NoOpStore tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Sqlite dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Sqlite.Tests\Paramore.Brighter.Sqlite.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Sqlite tests running on ubuntu'

# - task: DotNetCoreCLI@2
#   displayName: 'AWSSQS dotnet test $(buildConfiguration)'
#   timeoutInMinutes: 5
#   inputs:
#     command: 'test'
#     arguments: 'tests\Paramore.Brighter.AWSSQS.Tests\Paramore.Brighter.AWSSQS.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
#     testRunTitle: 'AWSSQS tests running on ubuntu'

- task: DockerCompose@0
  displayName: Run docker-compose for tests
  timeoutInMinutes: 5
  inputs:
    containerregistrytype: 'Azure Container Registry'
    dockerComposeFile: 'docker-compose.yaml'
    action: 'Run services'

- script: sleep 60
  displayName: sleep 60 seconds so docker has time to catch up 

- script: docker ps
  displayName: docker ps

- task: DotNetCoreCLI@2
  displayName: 'EventStore dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.EventStore.Tests\Paramore.Brighter.EventStore.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'EventStore tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Kafka dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Kafka.Tests\Paramore.Brighter.Kafka.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Kafka tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'MSSQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.MSSQL.Tests\Paramore.Brighter.MSSQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'MSSQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'MySQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.MySQL.Tests\Paramore.Brighter.MySQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'MySQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'PostgresSQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.PostgresSQL.Tests\Paramore.Brighter.PostgresSQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'PostgresSQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Redis dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Redis.Tests\Paramore.Brighter.Redis.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Redis tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'DynamoDB dotnet test $(buildConfiguration)'
  timeoutInMinutes: 15
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.DynamoDB.Tests\Paramore.Brighter.DynamoDB.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'DynamoDB tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'RabbitMQ dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.RMQ.Tests\Paramore.Brighter.RMQ.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'RabbitMQ tests running on ubuntu'


- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: false
    arguments: '--output $(Build.ArtifactStagingDirectory) --no-build'
    zipAfterPublish: false
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifacts'
    publishLocation: 'Container'

- task: NuGetCommand@2
  inputs:
    command: 'push'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: '22e7994e-1665-47ea-8089-92f0fb852d6f'
<commit_msg>Update azure-pipelines.yml for Azure Pipelines<commit_after># ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master
- building

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'
  Version.Major: 9
  Version.Minor: 0
  Version.MajorMinor: $(Version.Major).$(Version.Minor)
  Version.Revision: $[counter(variables['Version.MajorMinor'], 0)]

steps:
- script: sudo service mysql stop
  displayName: service mysql stop

- task: AWSShellScript@1
  inputs:
    awsCredentials: 'Brighter SNS Tests'
    regionName: 'eu-west-2'
    scriptType: 'inline'
    inlineScript: |
      aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
      aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
      aws configure set region eu-west-2
    failOnStandardError: true

- task: AWSCLI@1
  inputs:
    awsCredentials: 'Brighter SNS Tests'
    regionName: 'eu-west-2'
    awsCommand: 'configure'
    awsSubCommand: 'list'
    awsArguments: '--profile default'
    

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      Write-Host "Version.Major: $(Version.Major)"
      Write-Host "Version.Minor: $(Version.Minor)"
      Write-Host "Version.MajorMinor: $(Version.MajorMinor)"
      Write-Host "Version.Revision: $(Version.Revision)"
      Write-Host "semver build: $(Version.MajorMinor).$(Version.Revision)"

      $xml = [xml](Get-Content -Path src/Directory.Build.props)
      $xml.Project.PropertyGroup.AssemblyVersion = "$(Version.Major).0.0.0"
      $xml.Project.PropertyGroup.FileVersion = "$(Version.MajorMinor).$(Version.Revision).0"
      $xml.Project.PropertyGroup.InformationalVersion = "$(Version.MajorMinor).$(Version.Revision)"
      $xml.Project.PropertyGroup.Version = "$(Version.MajorMinor).$(Version.Revision)"
      $xml.Save("src/Directory.Build.props")

      Get-Content -Path ./src/Directory.Build.props
    pwsh: true

- task: DotNetCoreCLI@2
  displayName: 'dotnet build $(buildConfiguration)'
  inputs:
    command: 'build'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Core tests - dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests/Paramore.Brighter.Core.Tests/Paramore.Brighter.Core.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Fast tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'NoOpStore dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.NoOpStore.Tests\Paramore.Brighter.NoOpStore.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'NoOpStore tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Sqlite dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Sqlite.Tests\Paramore.Brighter.Sqlite.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Sqlite tests running on ubuntu'

# - task: DotNetCoreCLI@2
#   displayName: 'AWSSQS dotnet test $(buildConfiguration)'
#   timeoutInMinutes: 5
#   inputs:
#     command: 'test'
#     arguments: 'tests\Paramore.Brighter.AWSSQS.Tests\Paramore.Brighter.AWSSQS.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
#     testRunTitle: 'AWSSQS tests running on ubuntu'

- task: DockerCompose@0
  displayName: Run docker-compose for tests
  timeoutInMinutes: 5
  inputs:
    containerregistrytype: 'Azure Container Registry'
    dockerComposeFile: 'docker-compose.yaml'
    action: 'Run services'

- script: sleep 60
  displayName: sleep 60 seconds so docker has time to catch up 

- script: docker ps
  displayName: docker ps

- task: DotNetCoreCLI@2
  displayName: 'EventStore dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.EventStore.Tests\Paramore.Brighter.EventStore.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'EventStore tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Kafka dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Kafka.Tests\Paramore.Brighter.Kafka.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Kafka tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'MSSQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.MSSQL.Tests\Paramore.Brighter.MSSQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'MSSQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'MySQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.MySQL.Tests\Paramore.Brighter.MySQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'MySQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'PostgresSQL dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.PostgresSQL.Tests\Paramore.Brighter.PostgresSQL.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'PostgresSQL tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'Redis dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.Redis.Tests\Paramore.Brighter.Redis.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'Redis tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'DynamoDB dotnet test $(buildConfiguration)'
  timeoutInMinutes: 15
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.DynamoDB.Tests\Paramore.Brighter.DynamoDB.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'DynamoDB tests running on ubuntu'

- task: DotNetCoreCLI@2
  displayName: 'RabbitMQ dotnet test $(buildConfiguration)'
  timeoutInMinutes: 5
  inputs:
    command: 'test'
    arguments: 'tests\Paramore.Brighter.RMQ.Tests\Paramore.Brighter.RMQ.Tests.csproj -v normal --configuration $(buildConfiguration) --no-build'
    testRunTitle: 'RabbitMQ tests running on ubuntu'


- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: false
    arguments: '--output $(Build.ArtifactStagingDirectory) --no-build'
    zipAfterPublish: false
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifacts'
    publishLocation: 'Container'

- task: NuGetCommand@2
  inputs:
    command: 'push'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: '22e7994e-1665-47ea-8089-92f0fb852d6f'

{'fraction_non_alphanumeric': 0.11723901098901099, 'fraction_numerical': 0.009752747252747253, 'mean_word_length': 4.256678700361011, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7277028', 'n_tokens_mistral': 4878, 'n_tokens_neox': 4594, 'n_words': 1050}