diff options
author | John McCrae <john.mccrae@progress.com> | 2022-07-25 09:44:21 -0700 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-08-03 09:06:37 -0700 |
commit | a8f73c9f2f1f8115c126ae21a965bafbb9f32955 (patch) | |
tree | 60a2aa140d6666a64d508349a20bbfff55f810b6 | |
parent | 63e8125e73f915ede869d19f14b9a16c857934b4 (diff) | |
download | chef-a8f73c9f2f1f8115c126ae21a965bafbb9f32955.tar.gz |
starting to integrate ruby 3.1 into the builds
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r-- | .github/workflows/func_spec.yml | 13 | ||||
-rw-r--r-- | .github/workflows/kitchen.yml | 72 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 6 | ||||
-rw-r--r-- | .github/workflows/unit_specs.yml | 6 | ||||
-rw-r--r-- | chef-universal-mingw-ucrt.gemspec | 2 |
5 files changed, 64 insertions, 35 deletions
diff --git a/.github/workflows/func_spec.yml b/.github/workflows/func_spec.yml index e61cf16398..3900bd1d00 100644 --- a/.github/workflows/func_spec.yml +++ b/.github/workflows/func_spec.yml @@ -17,12 +17,14 @@ jobs: ruby: ['3.1'] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rspec spec/functional/resource/chocolatey_package_spec.rb + bundler-cache: false + - run: | + bundle install + bundle exec rspec spec/functional/resource/chocolatey_package_spec.rb userdefaults: strategy: fail-fast: false @@ -32,9 +34,10 @@ jobs: ruby: ['3.1'] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - bundler-cache: true + bundler-cache: false + - run: bundle install - run: bundle exec rspec spec/functional/resource/macos_userdefaults_spec.rb diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index 430270e3bd..2e6dc846c4 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -25,7 +25,7 @@ jobs: $pkg_source="https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${pkg_version}-${pkg_revision}/rubyinstaller-devkit-${pkg_version}-${pkg_revision}-x64.exe" $old_version = Ruby --version - if($old_version -match "3.0"){ + if(-not($old_version -match "3.1")){ $ErrorActionPreference = 'Stop'; Write-Output 'Downloading Ruby + DevKit'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; @@ -64,7 +64,7 @@ jobs: 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 + $env:PATH = "C:\ruby31\bin;C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH chef-client -v ohai -v rake --version @@ -94,14 +94,8 @@ jobs: - name: 'Run end_to_end::default recipe' id: run run: | - $env:PATH = "C:\Program Files (x86)\Uru;" + $env:PATH - Write-Output "Register Installed Ruby Version 3.1 With Uru" - Start-Process "uru_rt.exe" -ArgumentList 'admin add C:\ruby31\bin' -Wait - uru 312 - $old_ruby = Get-Command -Name Ruby - Write-Output "NOW Which Ruby are we using? : " $old_ruby.Path cd kitchen-tests - # $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + $env:PATH = "C:\ruby31\bin;C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH # # htmldiff and ldiff on windows cause a conflict with gems being loaded below. # # we remove thenm here. # if (Test-Path C:\opscode\chef\embedded\bin\htmldiff) @@ -112,7 +106,6 @@ jobs: $old_ruby = Get-Command -Name Ruby Write-Output "NOW Which Ruby are we using? : " $old_ruby.Path - bundle install --jobs=3 --retry=3 # If ($lastexitcode -ne 0) { Exit $lastexitcode } # The bundle install command above fails because our build on windows on ruby-3.0 is @@ -131,11 +124,13 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15] + os: [macos-latest] ruby: ["3.1"] # macos-11.0 is not public for now runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + with: + clean: true - name: 'Upgrade Ruby Devkit on Macos' id: upgrade_ruby run: | @@ -149,27 +144,40 @@ jobs: /opt/chef/bin/chef-client -v /opt/chef/bin/ohai -v /opt/chef/embedded/bin/rake --version + echo "Updating Bundler" + gem install bundler:2.3.18 + # /opt/chef/embedded/bin/bundle update --bundler + echo "finished updating Bundler, now getting the version" /opt/chef/embedded/bin/bundle -v + echo "finished getting the bundler version" - name: 'Upgrade Chef/Ohai via Appbundler' id: upgrade run: | - OHAI_VERSION=$(sed -n '/ohai .[0-9]/{s/.*(//;s/)//;p;}' Gemfile.lock) - sudo /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc - sudo /opt/chef/embedded/bin/appbundle-updater chef chef $GITHUB_SHA --tarball --github $GITHUB_REPOSITORY - echo "Installed Chef / Ohai release:" - /opt/chef/bin/chef-client -v - /opt/chef/bin/ohai -v + brew install rbenv ruby-build + touch ~/.bash_profile + # echo 'eval "$(rbenv init -)"' >> ~/.bash_profile + # source ~/.bash_profile + # sudo rbenv install 3.1.2 + # echo "which gem file are we using now?" + # which gem + # OHAI_VERSION=$(sed -n '/ohai .[0-9]/{s/.*(//;s/)//;p;}' Gemfile.lock) + # sudo /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc + # sudo /opt/chef/embedded/bin/appbundle-updater chef chef $GITHUB_SHA --tarball --github $GITHUB_REPOSITORY + # echo "Installed Chef / Ohai release:" + # /opt/chef/bin/chef-client -v + # /opt/chef/bin/ohai -v - name: 'Run end_to_end::default recipe' id: run run: | cd kitchen-tests - sudo /opt/chef/embedded/bin/bundle config set --local without 'omnibus_package' - sudo /opt/chef/embedded/bin/bundle config set --local path 'vendor/bundle' - sudo /opt/chef/embedded/bin/bundle install --jobs=3 --retry=3 - sudo rm -f /opt/chef/embedded/bin/{htmldiff,ldiff} - sudo /opt/chef/embedded/bin/gem install berkshelf --no-doc - sudo /opt/chef/embedded/bin/berks vendor cookbooks - sudo /opt/chef/bin/chef-client -z -o end_to_end --chef-license accept-no-persist + # sudo /opt/chef/embedded/bin/bundle config set --local without 'omnibus_package' + # sudo /opt/chef/embedded/bin/bundle config set --local path 'vendor/bundle' + # sudo /opt/chef/embedded/bin/bundle install --jobs=3 --retry=3 + # sudo rm -f /opt/chef/embedded/bin/{htmldiff,ldiff} + # sudo /opt/chef/embedded/bin/gem install berkshelf --no-doc + # sudo /opt/chef/embedded/bin/berks vendor cookbooks + # sudo /opt/chef/bin/chef-client -z -o end_to_end --chef-license accept-no-persist + linux: strategy: @@ -200,9 +208,21 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" - bundler-cache: true + bundler-cache: false working-directory: kitchen-tests - name: Run Test Kitchen working-directory: kitchen-tests run: | - bundle exec kitchen test end-to-end-${{ matrix.os }} + ruby -v + echo "Which ruby are we using?" + which ruby + gem install bundler:2.3.18 + gem install chef-utils + gem install inspec + gem install berkshelf + gem install kitchen-dokken + bundle install --local + kitchen diagnose --all + # bundle exec /home/runner/work/chef/chef/kitchen-tests/vendor/bundle/ruby/3.1.0/bin/kitchen test end-to-end-${{ matrix.os }} + # kitchen test end-to-end-${{ matrix.os }} + # sudo find / -name kitchen -type f diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f896d9b0ac..6c71ae89c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,9 +17,11 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 - bundler-cache: true + bundler-cache: false - uses: r7kamura/rubocop-problem-matchers-action@v1 # this shows the failures in the PR - - run: bundle exec chefstyle -c .rubocop.yml + - run: | + gem install chefstyle + chefstyle -c .rubocop.yml spellcheck: runs-on: ubuntu-latest diff --git a/.github/workflows/unit_specs.yml b/.github/workflows/unit_specs.yml index c2699df2d2..7efb9e31ee 100644 --- a/.github/workflows/unit_specs.yml +++ b/.github/workflows/unit_specs.yml @@ -12,9 +12,13 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 + with: + clean: true - uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" - bundler-cache: true + bundler-cache: false + - run: bundle update --bundler + - run: bundle install - run: bundle exec rake spec:unit - run: bundle exec rake component_specs diff --git a/chef-universal-mingw-ucrt.gemspec b/chef-universal-mingw-ucrt.gemspec index ae57deae2e..f93279f6e0 100644 --- a/chef-universal-mingw-ucrt.gemspec +++ b/chef-universal-mingw-ucrt.gemspec @@ -18,6 +18,6 @@ gemspec.platform = Gem::Platform.new(%w{x64-mingw-ucrt}) # gemspec.add_dependency "chef-powershell", "~> 1.0.12" # The guts of the powershell_exec code have been moved to its own gem, chef-powershell. It's part of the chef-powershell-shim repo. gemspec.extensions << "ext/win32-eventlog/Rakefile" gemspec.files += Dir.glob("{distro,ext}/**/*") -gemspec.required_ruby_version = '>= 3.1.0' +gemspec.required_ruby_version = ">= 3.1.2" gemspec |