summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-04-22 17:37:04 -0700
committerTim Smith <tsmith84@gmail.com>2021-04-22 17:42:36 -0700
commit1f89b3a03a41f914fd8c8549be3a8568d64844b9 (patch)
treea0060bb67a1e9bd4422ea10b1ed0cff40c03e44a
parentdc0e96bc697ef7170902b2f374d8c4c1c6a943e7 (diff)
downloadchef-1f89b3a03a41f914fd8c8549be3a8568d64844b9.tar.gz
Add Test Kitchen tests in GitHub Actions for Windows
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.github/workflows/kitchen.yml53
-rw-r--r--azure-pipelines.yml42
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'