From 769e1d6555d9c4770230454f06149d12c12b7d8f Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 22 Dec 2021 08:34:17 +0000 Subject: [PATCH] ci(proxy): replace deprecated Windows `2016` with `2022` [skip ci] * Semi-automated using https://github.com/myii/ssf-formula/pull/393 --- .github/workflows/kitchen.windows.yml | 84 +++++++++--------- kitchen.windows.yml | 2 +- kitchen.yml | 2 +- test/integration/share/libraries/system.rb | 2 + .../files/_mapdata/windows-2022-server.yaml | 85 +++++++++++++++++++ 5 files changed, 131 insertions(+), 44 deletions(-) create mode 100644 test/integration/windows/files/_mapdata/windows-2022-server.yaml diff --git a/.github/workflows/kitchen.windows.yml b/.github/workflows/kitchen.windows.yml index 959233e..de058db 100644 --- a/.github/workflows/kitchen.windows.yml +++ b/.github/workflows/kitchen.windows.yml @@ -11,6 +11,48 @@ env: KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' jobs: + test-2022: + runs-on: 'windows-2022' + strategy: + fail-fast: false + matrix: + instance: + - windows-windows-2022-latest-py3 + steps: + - name: 'Check out code' + uses: 'actions/checkout@v2' + - name: 'Install Chef' + uses: 'actionshub/chef-install@1.1.0' + with: + project: 'chef' + version: '16.10.8' + - name: 'Add Chef bindir to PATH' + uses: 'myci-actions/export-env-var-powershell@1' + with: + name: 'PATH' + value: "C:\\opscode\\chef\\bin;\ + C:\\opscode\\chef\\embedded\\bin;$env:PATH" + - name: 'Set up Bundler cache' + uses: 'actions/cache@v1' + with: + path: 'vendor/bundle' + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" + restore-keys: "${{ runner.os }}-gems-" + - name: 'Set up test user' + run: | + $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force + New-LocalUser $env:machine_user -Password $password + Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user + - name: 'Set up WinRM' + run: | + Set-WSManQuickConfig -Force + - name: 'Run Bundler' + run: | + ruby --version + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: 'Run Test Kitchen' + run: 'bundle exec kitchen verify ${{ matrix.instance }}' test-2019: runs-on: 'windows-2019' strategy: @@ -53,45 +95,3 @@ jobs: bundle install --jobs 4 --retry 3 - name: 'Run Test Kitchen' run: 'bundle exec kitchen verify ${{ matrix.instance }}' - test-2016: - runs-on: 'windows-2016' - strategy: - fail-fast: false - matrix: - instance: - - windows-windows-2016-latest-py3 - steps: - - name: 'Check out code' - uses: 'actions/checkout@v2' - - name: 'Install Chef' - uses: 'actionshub/chef-install@1.1.0' - with: - project: 'chef' - version: '16.10.8' - - name: 'Add Chef bindir to PATH' - uses: 'myci-actions/export-env-var-powershell@1' - with: - name: 'PATH' - value: "C:\\opscode\\chef\\bin;\ - C:\\opscode\\chef\\embedded\\bin;$env:PATH" - - name: 'Set up Bundler cache' - uses: 'actions/cache@v1' - with: - path: 'vendor/bundle' - key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" - restore-keys: "${{ runner.os }}-gems-" - - name: 'Set up test user' - run: | - $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force - New-LocalUser $env:machine_user -Password $password - Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user - - name: 'Set up WinRM' - run: | - Set-WSManQuickConfig -Force - - name: 'Run Bundler' - run: | - ruby --version - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - - name: 'Run Test Kitchen' - run: 'bundle exec kitchen verify ${{ matrix.instance }}' diff --git a/kitchen.windows.yml b/kitchen.windows.yml index 74aa70b..b7037c6 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -14,5 +14,5 @@ provisioner: salt_bootstrap_options: -pythonVersion 3 -version 3003.3 platforms: + - name: windows-2022-latest-py3 - name: windows-2019-latest-py3 - - name: windows-2016-latest-py3 diff --git a/kitchen.yml b/kitchen.yml index 5917b6c..d0574ef 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -834,8 +834,8 @@ suites: includes: - windows-10-latest-py3 - windows-81-latest-py3 + - windows-2022-latest-py3 - windows-2019-latest-py3 - - windows-2016-latest-py3 provisioner: state_top: base: diff --git a/test/integration/share/libraries/system.rb b/test/integration/share/libraries/system.rb index af65449..7471ddc 100644 --- a/test/integration/share/libraries/system.rb +++ b/test/integration/share/libraries/system.rb @@ -61,6 +61,8 @@ class SystemResource < Inspec.resource(1) # rubocop:enable Style/NumericLiterals,Layout/LineLength when 'windows_8.1_pro' '8.1' + when 'windows_server_2022_datacenter' + '2022-server' when 'windows_server_2019_datacenter' '2019-server' when 'windows_server_2016_datacenter' diff --git a/test/integration/windows/files/_mapdata/windows-2022-server.yaml b/test/integration/windows/files/_mapdata/windows-2022-server.yaml new file mode 100644 index 0000000..dfe8b59 --- /dev/null +++ b/test/integration/windows/files/_mapdata/windows-2022-server.yaml @@ -0,0 +1,85 @@ +# yamllint disable rule:indentation rule:line-length +# Windows-2022Server +--- +values: + archives: + pkgs: + required: + - curl + - bzip2 + - gzip + required: + archives: {} + types: + - tar + - zip + - rar + unwanted: [] + wanted: {} + chocolatey: + required: + pkgs: [] + states: [] + unwanted: + - GoogleChrome + - hg + wanted: + Firefox: + package_args: "/l:en-GB" + jq: + force: true + version: '1.5' + notepadplusplus: + version: 7.8.8 + gems: + required: + pkgs: [] + states: [] + unwanted: [] + wanted: [] + golang: + clean: [] + goget: [] + kernel: windows + npms: + required: + pkgs: [] + states: [] + unwanted: [] + wanted: [] + pips: + config: [] + required: + pkgs: [] + states: [] + unwanted: [] + wanted: [] + pkgs: + held: {} + required: + pkgs: [] + states: [] + unwanted: [] + wanted: [] + remote_pkgs: {} + retry_options: + attempts: 3 + interval: 60 + splay: 10 + until: true + rootuser: root + snaps: + classic: [] + collides: [] + packages: + - snapd + - fuse + required: + pkgs: [] + states: [] + service: + - snapd + symlink: false + unwanted: [] + wanted: [] + tmpdir: "/tmp/saltstack-packages-formula-archives"