|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# vim: ft=yaml |
| 3 | +--- |
| 4 | +name: 'Kitchen (Windows)' |
| 5 | +'on': ['push', 'pull_request'] |
| 6 | + |
| 7 | +env: |
| 8 | + machine_user: kitchen |
| 9 | + machine_pass: Pass@word1 |
| 10 | + machine_port: 5985 |
| 11 | + KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' |
| 12 | + |
| 13 | +jobs: |
| 14 | + test-2022: |
| 15 | + runs-on: 'windows-2022' |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + instance: |
| 20 | + - default-windows-2022-latest-py3 |
| 21 | + # - archive-windows-2022-latest-py3 |
| 22 | + steps: |
| 23 | + - name: 'Check out code' |
| 24 | + uses: 'actions/checkout@v2' |
| 25 | + - name: 'Install Chef' |
| 26 | + uses: 'actionshub/[email protected]' |
| 27 | + with: |
| 28 | + project: 'chef' |
| 29 | + version: '16.10.8' |
| 30 | + - name: 'Add Chef bindir to PATH' |
| 31 | + uses: 'myci-actions/export-env-var-powershell@1' |
| 32 | + with: |
| 33 | + name: 'PATH' |
| 34 | + value: "C:\\opscode\\chef\\bin;\ |
| 35 | + C:\\opscode\\chef\\embedded\\bin;$env:PATH" |
| 36 | + - name: 'Set up Bundler cache' |
| 37 | + uses: 'actions/cache@v1' |
| 38 | + with: |
| 39 | + path: 'vendor/bundle' |
| 40 | + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" |
| 41 | + restore-keys: "${{ runner.os }}-gems-" |
| 42 | + - name: 'Set up test user' |
| 43 | + run: | |
| 44 | + $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force |
| 45 | + New-LocalUser $env:machine_user -Password $password |
| 46 | + Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user |
| 47 | + - name: 'Set up WinRM' |
| 48 | + run: | |
| 49 | + Set-WSManQuickConfig -Force |
| 50 | + - name: 'Run Bundler' |
| 51 | + run: | |
| 52 | + ruby --version |
| 53 | + bundle config path vendor/bundle |
| 54 | + bundle install --jobs 4 --retry 3 |
| 55 | + - name: 'Run Test Kitchen' |
| 56 | + run: 'bundle exec kitchen verify ${{ matrix.instance }}' |
| 57 | + test-2019: |
| 58 | + runs-on: 'windows-2019' |
| 59 | + strategy: |
| 60 | + fail-fast: false |
| 61 | + matrix: |
| 62 | + instance: |
| 63 | + - default-windows-2019-latest-py3 |
| 64 | + # - archive-windows-2019-latest-py3 |
| 65 | + steps: |
| 66 | + - name: 'Check out code' |
| 67 | + uses: 'actions/checkout@v2' |
| 68 | + - name: 'Install Chef' |
| 69 | + uses: 'actionshub/[email protected]' |
| 70 | + with: |
| 71 | + project: 'chef' |
| 72 | + version: '16.10.8' |
| 73 | + - name: 'Add Chef bindir to PATH' |
| 74 | + uses: 'myci-actions/export-env-var-powershell@1' |
| 75 | + with: |
| 76 | + name: 'PATH' |
| 77 | + value: "C:\\opscode\\chef\\bin;\ |
| 78 | + C:\\opscode\\chef\\embedded\\bin;$env:PATH" |
| 79 | + - name: 'Set up Bundler cache' |
| 80 | + uses: 'actions/cache@v1' |
| 81 | + with: |
| 82 | + path: 'vendor/bundle' |
| 83 | + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" |
| 84 | + restore-keys: "${{ runner.os }}-gems-" |
| 85 | + - name: 'Set up test user' |
| 86 | + run: | |
| 87 | + $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force |
| 88 | + New-LocalUser $env:machine_user -Password $password |
| 89 | + Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user |
| 90 | + - name: 'Set up WinRM' |
| 91 | + run: | |
| 92 | + Set-WSManQuickConfig -Force |
| 93 | + - name: 'Run Bundler' |
| 94 | + run: | |
| 95 | + ruby --version |
| 96 | + bundle config path vendor/bundle |
| 97 | + bundle install --jobs 4 --retry 3 |
| 98 | + - name: 'Run Test Kitchen' |
| 99 | + run: 'bundle exec kitchen verify ${{ matrix.instance }}' |
0 commit comments