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