<commit_before>#---------------------------------# 
#      environment configuration  # 
#---------------------------------# 
version: 3.6.{build}.0
install: 
  - cinst -y pester
  - git clone https://github.com/PowerShell/DscResource.Tests
  - ps: Push-Location
  - cd DscResource.Tests
  - ps: Import-Module .\TestHelper.psm1 -force
  - ps: Pop-Location

#---------------------------------# 
#      build configuration        # 
#---------------------------------# 

build: false

#---------------------------------# 
#      test configuration         # 
#---------------------------------# 

test_script:
    - ps: |
        $testResultsFile = ".\TestsResults.xml"
        $tempModulePath = (Resolve-Path (join-path $PWD '..')).ProviderPath
        $env:PSModulePath = "$env:PSModulePath;$tempModulePath"
        $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
        (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
        if ($res.FailedCount -gt 0) { 
            throw "$($res.FailedCount) tests failed."
        }
    
#---------------------------------# 
#      deployment configuration   # 
#---------------------------------# 

# scripts to run before deployment 
before_deploy: 
  - ps: |
      # Creating project artifact
      $stagingDirectory = (Resolve-Path ..).Path
      $manifest = Join-Path $pwd "xPSDesiredStateConfiguration.psd1"
      (Get-Content $manifest -Raw).Replace("3.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
      $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip"
      Add-Type -assemblyname System.IO.Compression.FileSystem
      [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath)
      
      # Creating NuGet package artifact
      New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath .
      nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory .
      $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
      $nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName
      
      @(
          # You can add other artifacts here
          $zipFilePath,
          $nuGetPackagePath
      ) | % { 
          Write-Host "Pushing package $_ as Appveyor artifact"
          Push-AppveyorArtifact $_<commit_msg>Replacing before_deploy with deploy_script<commit_after>#---------------------------------# 
#      environment configuration  # 
#---------------------------------# 
version: 3.6.{build}.0
install: 
  - cinst -y pester
  - git clone https://github.com/PowerShell/DscResource.Tests
  - ps: Push-Location
  - cd DscResource.Tests
  - ps: Import-Module .\TestHelper.psm1 -force
  - ps: Pop-Location

#---------------------------------# 
#      build configuration        # 
#---------------------------------# 

build: false

#---------------------------------# 
#      test configuration         # 
#---------------------------------# 

test_script:
    - ps: |
        $testResultsFile = ".\TestsResults.xml"
        $tempModulePath = (Resolve-Path (join-path $PWD '..')).ProviderPath
        $env:PSModulePath = "$env:PSModulePath;$tempModulePath"
        $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
        (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
        if ($res.FailedCount -gt 0) { 
            throw "$($res.FailedCount) tests failed."
        }
    
#---------------------------------# 
#      deployment configuration   # 
#---------------------------------# 

# scripts to run before deployment 
deploy_script: 
  - ps: |
      # Creating project artifact
      $stagingDirectory = (Resolve-Path ..).Path
      $manifest = Join-Path $pwd "xPSDesiredStateConfiguration.psd1"
      (Get-Content $manifest -Raw).Replace("3.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
      $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip"
      Add-Type -assemblyname System.IO.Compression.FileSystem
      [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath)
      
      # Creating NuGet package artifact
      New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath .
      nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory .
      $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
      $nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName
      
      @(
          # You can add other artifacts here
          $zipFilePath,
          $nuGetPackagePath
      ) | % { 
          Write-Host "Pushing package $_ as Appveyor artifact"
          Push-AppveyorArtifact $_
{'fraction_non_alphanumeric': 0.20991465407662974, 'fraction_numerical': 0.0036317414200108954, 'mean_word_length': 2.143835616438356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 2, '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': '1140847', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1650, 'n_words': 291}