diff options
-rw-r--r-- | .github/workflows/kitchen.yml | 53 | ||||
-rw-r--r-- | azure-pipelines.yml | 42 |
2 files changed, 53 insertions, 42 deletions
diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml new file mode 100644 index 0000000000..df7fd3e1b0 --- /dev/null +++ b/.github/workflows/kitchen.yml @@ -0,0 +1,53 @@ +--- +name: kitchen + +"on": + pull_request: + push: + branches: + - master + +jobs: + windows: + strategy: + fail-fast: false + matrix: + os: [windows-2019, windows-2016] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: 'Install Chef/Ohai from Omnitruck' + id: install_chef + run: | + . { Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 } | Invoke-Expression; Install-Project -project chef -channel current + $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + chef-client -v + ohai -v + rake --version + bundle -v + - name: 'Upgrade Chef/Ohai via Appbundler' + id: upgrade + run: | + $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) + gem install appbundler appbundle-updater --no-doc + appbundle-updater chef chef $env:BUILD_SOURCEVERSION --tarball --github chef/chef + Write-Output "Installed Chef / Ohai release:" + chef-client -v + ohai -v + - name: 'Run end_to_end::default recipe' + id: run + run: | + cd kitchen-tests + $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + bundle config set without 'omnibus_package ruby_prof' + bundle install --jobs=3 --retry=3 --path=vendor/bundle + gem install berkshelf --no-doc + # berks emits a ruby warning when it loads net/http due to a previously + # defined constant. Even though it is just a warning, powershell immediately + # exits 1. I'm not sure why but this just suppresses the warnings. + $env:RUBYOPT="-W0" + berks vendor cookbooks + # restore the default warning level + $env:RUBYOPT="-W1" + chef-client -z -o end_to_end --chef-license accept-no-persist diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b2f3acbf8c..ffa1612b6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -49,45 +49,3 @@ jobs: sudo /opt/chef/embedded/bin/berks vendor cookbooks sudo /opt/chef/bin/chef-client -z -o end_to_end --chef-license accept-no-persist displayName: 'Run end_to_end::default recipe' - - - job: - strategy: - matrix: - windows_kitchen_tests: - imageName: 'windows-latest' - - steps: - - powershell: | - . { Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 } | Invoke-Expression; Install-Project -project chef -channel current - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - chef-client -v - ohai -v - rake --version - bundle -v - displayName: 'Install Chef/Ohai from Omnitruck' - - - powershell: | - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) - gem install appbundler appbundle-updater --no-doc - appbundle-updater chef chef $env:BUILD_SOURCEVERSION --tarball --github chef/chef - Write-Output "Installed Chef / Ohai release:" - chef-client -v - ohai -v - displayName: 'Upgrade Chef/Ohai via Appbundler' - - - powershell: | - cd kitchen-tests - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - bundle config set without 'omnibus_package ruby_prof' - bundle install --jobs=3 --retry=3 --path=vendor/bundle - gem install berkshelf --no-doc - # berks emits a ruby warning when it loads net/http due to a previously - # defined constant. Even though it is just a warning, powershell immediately - # exits 1. I'm not sure why but this just suppresses the warnings. - $env:RUBYOPT="-W0" - berks vendor cookbooks - # restore the default warning level - $env:RUBYOPT="-W1" - chef-client -z -o end_to_end --chef-license accept-no-persist - displayName: 'Run end_to_end::default recipe' |