2021-03-26 12:15:22 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=yaml
|
2020-06-11 03:16:21 +02:00
|
|
|
---
|
2021-03-03 22:35:14 +01:00
|
|
|
name: 'Kitchen (Windows)'
|
2021-03-26 12:15:22 +01:00
|
|
|
'on': ['push', 'pull_request']
|
2020-06-11 03:16:21 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
machine_user: kitchen
|
|
|
|
machine_pass: Pass@word1
|
|
|
|
machine_port: 5985
|
2021-03-26 12:15:22 +01:00
|
|
|
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
|
2020-06-11 03:16:21 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-03-26 12:15:22 +01:00
|
|
|
test-2019:
|
|
|
|
runs-on: 'windows-2019'
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
instance:
|
2021-11-17 22:53:16 +01:00
|
|
|
- default-windows-2019-latest-py3
|
2020-06-11 03:16:21 +02:00
|
|
|
steps:
|
2021-03-26 12:15:22 +01:00
|
|
|
- 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'
|
2021-12-22 00:16:43 +01:00
|
|
|
run: |
|
|
|
|
Set-WSManQuickConfig -Force
|
2021-03-26 12:15:22 +01:00
|
|
|
- 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-2016:
|
|
|
|
runs-on: 'windows-2016'
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
instance:
|
2021-11-17 22:53:16 +01:00
|
|
|
- default-windows-2016-latest-py3
|
2021-03-26 12:15:22 +01:00
|
|
|
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'
|
2020-06-11 03:16:21 +02:00
|
|
|
with:
|
2021-03-26 12:15:22 +01:00
|
|
|
path: 'vendor/bundle'
|
|
|
|
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
|
|
|
|
restore-keys: "${{ runner.os }}-gems-"
|
|
|
|
- name: 'Set up test user'
|
2020-06-11 03:16:21 +02:00
|
|
|
run: |
|
|
|
|
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
|
|
|
|
New-LocalUser $env:machine_user -Password $password
|
|
|
|
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
|
2021-03-26 12:15:22 +01:00
|
|
|
- name: 'Set up WinRM'
|
2021-12-22 00:16:43 +01:00
|
|
|
run: |
|
|
|
|
Set-WSManQuickConfig -Force
|
2021-03-26 12:15:22 +01:00
|
|
|
- name: 'Run Bundler'
|
2020-06-11 03:16:21 +02:00
|
|
|
run: |
|
2021-03-26 12:15:22 +01:00
|
|
|
ruby --version
|
2020-06-11 03:16:21 +02:00
|
|
|
bundle config path vendor/bundle
|
|
|
|
bundle install --jobs 4 --retry 3
|
2021-03-26 12:15:22 +01:00
|
|
|
- name: 'Run Test Kitchen'
|
|
|
|
run: 'bundle exec kitchen verify ${{ matrix.instance }}'
|