ci: enable Vagrant-based testing using GitHub Actions
* Semi-automated using https://github.com/myii/ssf-formula/pull/304
This commit is contained in:
parent
9816f473c5
commit
163c77fcee
|
@ -0,0 +1,36 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
|
name: 'Kitchen Vagrant (FreeBSD, OpenBSD & Windows)'
|
||||||
|
'on': ['push', 'pull_request']
|
||||||
|
|
||||||
|
env:
|
||||||
|
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: 'macos-10.15'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
instance:
|
||||||
|
- v3002-py3-freebsd-122-latest-py3
|
||||||
|
- v3002-py3-freebsd-114-latest-py3
|
||||||
|
- v3001-py3-openbsd-68-latest-py3
|
||||||
|
- v3002-py3-windows-81-latest-py3
|
||||||
|
steps:
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: 'actions/checkout@v2'
|
||||||
|
- 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: '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 }}'
|
|
@ -1,39 +1,101 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
---
|
---
|
||||||
name: 'Kitchen (Windows)'
|
name: 'Kitchen (Windows)'
|
||||||
|
'on': ['push', 'pull_request']
|
||||||
'on': [push, pull_request]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
machine_user: kitchen
|
machine_user: kitchen
|
||||||
machine_pass: Pass@word1
|
machine_pass: Pass@word1
|
||||||
machine_port: 5985
|
machine_port: 5985
|
||||||
KITCHEN_LOCAL_YAML: kitchen.windows.yml
|
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test-2019:
|
||||||
runs-on: windows-latest
|
runs-on: 'windows-2019'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
instance:
|
||||||
|
- v3002-py3-windows-2019-latest-py3
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: 'Check out code'
|
||||||
- uses: actions/cache@v1
|
uses: 'actions/checkout@v2'
|
||||||
|
- name: 'Install Chef'
|
||||||
|
uses: 'actionshub/chef-install@1.1.0'
|
||||||
with:
|
with:
|
||||||
path: vendor/bundle
|
project: 'chef'
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
version: '16.10.8'
|
||||||
restore-keys: |
|
- name: 'Add Chef bindir to PATH'
|
||||||
${{ runner.os }}-gems-
|
uses: 'myci-actions/export-env-var-powershell@1'
|
||||||
- shell: powershell
|
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: |
|
run: |
|
||||||
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
|
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
|
||||||
New-LocalUser $env:machine_user -Password $password
|
New-LocalUser $env:machine_user -Password $password
|
||||||
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
|
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
|
||||||
- shell: powershell
|
- name: 'Set up WinRM'
|
||||||
run: >
|
run: >
|
||||||
Set-WSManQuickConfig -Force;
|
Set-WSManQuickConfig -Force;
|
||||||
Set-WSManInstance -ResourceURI winrm/config/service
|
Set-WSManInstance -ResourceURI winrm/config/service
|
||||||
-ValueSet @{AllowUnencrypted="true"}
|
-ValueSet @{AllowUnencrypted="true"}
|
||||||
- run: gem install bundler --quiet --no-document
|
- name: 'Run Bundler'
|
||||||
- name: Bundle install
|
|
||||||
run: |
|
run: |
|
||||||
|
ruby --version
|
||||||
bundle config path vendor/bundle
|
bundle config path vendor/bundle
|
||||||
bundle install --jobs 4 --retry 3
|
bundle install --jobs 4 --retry 3
|
||||||
- run: bundle exec kitchen test
|
- name: 'Run Test Kitchen'
|
||||||
|
run: 'bundle exec kitchen verify ${{ matrix.instance }}'
|
||||||
|
test-2016:
|
||||||
|
runs-on: 'windows-2016'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
instance:
|
||||||
|
- v3002-py3-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;
|
||||||
|
Set-WSManInstance -ResourceURI winrm/config/service
|
||||||
|
-ValueSet @{AllowUnencrypted="true"}
|
||||||
|
- 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 }}'
|
||||||
|
|
|
@ -135,7 +135,7 @@ v3002-py3-fedora-33-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3002-py3-amazonlinux-2-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-amazonlinux-2-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3002-py3-oraclelinux-8-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-oraclelinux-8-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3002-py3-oraclelinux-7-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-oraclelinux-7-3002-5-py3: {extends: '.test_instance'}
|
||||||
# v3002-py3-arch-base-latest-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-arch-base-latest-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3002-py3-gentoo-stage3-latest-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-gentoo-stage3-latest-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3002-py3-gentoo-stage3-systemd-3002-5-py3: {extends: '.test_instance'}
|
v3002-py3-gentoo-stage3-systemd-3002-5-py3: {extends: '.test_instance'}
|
||||||
v3001-py3-debian-10-3001-6-py3: {extends: '.test_instance'}
|
v3001-py3-debian-10-3001-6-py3: {extends: '.test_instance'}
|
||||||
|
|
|
@ -95,7 +95,7 @@ jobs:
|
||||||
- env: INSTANCE=v3002-py3-amazonlinux-2-3002-5-py3
|
- env: INSTANCE=v3002-py3-amazonlinux-2-3002-5-py3
|
||||||
- env: INSTANCE=v3002-py3-oraclelinux-8-3002-5-py3
|
- env: INSTANCE=v3002-py3-oraclelinux-8-3002-5-py3
|
||||||
- env: INSTANCE=v3002-py3-oraclelinux-7-3002-5-py3
|
- env: INSTANCE=v3002-py3-oraclelinux-7-3002-5-py3
|
||||||
# - env: INSTANCE=v3002-py3-arch-base-latest-3002-5-py3
|
- env: INSTANCE=v3002-py3-arch-base-latest-3002-5-py3
|
||||||
- env: INSTANCE=v3002-py3-gentoo-stage3-latest-3002-5-py3
|
- env: INSTANCE=v3002-py3-gentoo-stage3-latest-3002-5-py3
|
||||||
- env: INSTANCE=v3002-py3-gentoo-stage3-systemd-3002-5-py3
|
- env: INSTANCE=v3002-py3-gentoo-stage3-systemd-3002-5-py3
|
||||||
- env: INSTANCE=v3001-py3-debian-10-3001-6-py3
|
- env: INSTANCE=v3001-py3-debian-10-3001-6-py3
|
||||||
|
|
|
@ -3,37 +3,48 @@
|
||||||
---
|
---
|
||||||
driver:
|
driver:
|
||||||
name: vagrant
|
name: vagrant
|
||||||
|
cache_directory: false
|
||||||
|
customize:
|
||||||
|
usbxhci: 'off'
|
||||||
|
gui: false
|
||||||
|
linked_clone: true
|
||||||
|
ssh:
|
||||||
|
shell: /bin/sh
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: windows-81
|
- name: freebsd-122-latest-py3
|
||||||
|
driver:
|
||||||
|
box: bento/freebsd-12.2
|
||||||
|
- name: freebsd-114-latest-py3
|
||||||
|
driver:
|
||||||
|
box: bento/freebsd-11.4
|
||||||
|
- name: openbsd-68-latest-py3
|
||||||
|
driver:
|
||||||
|
box: generic/openbsd6
|
||||||
|
ssh:
|
||||||
|
shell: /bin/ksh
|
||||||
|
- name: windows-81-latest-py3
|
||||||
driver:
|
driver:
|
||||||
box: techneg/win81x64-pro-salt
|
box: techneg/win81x64-pro-salt
|
||||||
gui: false
|
cache_directory: "/omnibus/cache"
|
||||||
linked_clone: true
|
customize: {}
|
||||||
|
ssh: {}
|
||||||
provisioner:
|
provisioner:
|
||||||
init_environment: >
|
salt_install: none
|
||||||
salt-call --local state.single file.managed
|
# yamllint disable rule:line-length
|
||||||
C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls
|
init_environment: |
|
||||||
source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls
|
# Workaround to allow `kitchen converge` to be used multiple times
|
||||||
skip_verify=True makedirs=True
|
# without having to `kitchen destroy` first: remove state files cached by
|
||||||
|
# Salt during the previous `converge` (if present)
|
||||||
|
rm -recurse `
|
||||||
|
C:\Users\vagrant\AppData\Local\Temp\kitchen\var\cache\salt\minion\files\base `
|
||||||
|
-ErrorAction SilentlyContinue
|
||||||
|
salt-call --local state.single file.managed `
|
||||||
|
C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls `
|
||||||
|
source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls `
|
||||||
|
skip_verify=True makedirs=True
|
||||||
|
exit 0
|
||||||
|
# yamllint enable rule:line-length
|
||||||
|
|
||||||
suites:
|
provisioner:
|
||||||
- name: v3000-py3
|
salt_install: bootstrap
|
||||||
provisioner:
|
|
||||||
state_top:
|
|
||||||
base:
|
|
||||||
'*':
|
|
||||||
- salt._mapdata
|
|
||||||
- salt.minion
|
|
||||||
pillars:
|
|
||||||
top.sls:
|
|
||||||
base:
|
|
||||||
'*':
|
|
||||||
- salt
|
|
||||||
- v3000-py3
|
|
||||||
pillars_from_files:
|
|
||||||
salt.sls: test/salt/pillar/salt.sls
|
|
||||||
v3000-py3.sls: test/salt/pillar/v3000-py3.sls
|
|
||||||
verifier:
|
|
||||||
inspec_tests:
|
|
||||||
- path: test/integration/v3000-py3
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
---
|
---
|
||||||
driver:
|
driver:
|
||||||
name: proxy
|
name: proxy
|
||||||
|
@ -8,34 +10,16 @@ driver:
|
||||||
password: Pass@word1
|
password: Pass@word1
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: windows
|
- name: windows-2019-latest-py3
|
||||||
|
- name: windows-2016-latest-py3
|
||||||
|
|
||||||
provisioner:
|
provisioner:
|
||||||
salt_install: bootstrap
|
salt_install: bootstrap
|
||||||
salt_bootstrap_options: -pythonVersion 3 -version 3000.3
|
salt_bootstrap_options: -pythonVersion 3 -version 3002.5
|
||||||
init_environment: >
|
# yamllint disable rule:line-length
|
||||||
C:\salt\salt-call --local state.single file.managed
|
init_environment: |
|
||||||
C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls
|
C:\salt\salt-call --local state.single file.managed `
|
||||||
source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls
|
C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls `
|
||||||
skip_verify=True makedirs=True
|
source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls `
|
||||||
|
skip_verify=True makedirs=True
|
||||||
suites:
|
# yamllint enable rule:line-length
|
||||||
- name: v3000-py3
|
|
||||||
provisioner:
|
|
||||||
state_top:
|
|
||||||
base:
|
|
||||||
'*':
|
|
||||||
- salt._mapdata
|
|
||||||
- salt.minion
|
|
||||||
pillars:
|
|
||||||
top.sls:
|
|
||||||
base:
|
|
||||||
'*':
|
|
||||||
- salt
|
|
||||||
- v3000-py3
|
|
||||||
pillars_from_files:
|
|
||||||
salt.sls: test/salt/pillar/salt.sls
|
|
||||||
v3000-py3.sls: test/salt/pillar/v3000-py3.sls
|
|
||||||
verifier:
|
|
||||||
inspec_tests:
|
|
||||||
- path: test/integration/v3000-py3
|
|
||||||
|
|
|
@ -324,6 +324,11 @@ suites:
|
||||||
- arch-base-latest-3002-5-py3
|
- arch-base-latest-3002-5-py3
|
||||||
- gentoo-stage3-latest-3002-5-py3
|
- gentoo-stage3-latest-3002-5-py3
|
||||||
- gentoo-stage3-systemd-3002-5-py3
|
- gentoo-stage3-systemd-3002-5-py3
|
||||||
|
- freebsd-122-latest-py3
|
||||||
|
- freebsd-114-latest-py3
|
||||||
|
- windows-81-latest-py3
|
||||||
|
- windows-2019-latest-py3
|
||||||
|
- windows-2016-latest-py3
|
||||||
provisioner:
|
provisioner:
|
||||||
state_top:
|
state_top:
|
||||||
base:
|
base:
|
||||||
|
@ -363,6 +368,7 @@ suites:
|
||||||
- arch-base-latest-3001-6-py3
|
- arch-base-latest-3001-6-py3
|
||||||
- gentoo-stage3-latest-3001-6-py3
|
- gentoo-stage3-latest-3001-6-py3
|
||||||
- gentoo-stage3-systemd-3001-6-py3
|
- gentoo-stage3-systemd-3001-6-py3
|
||||||
|
- openbsd-68-latest-py3
|
||||||
provisioner:
|
provisioner:
|
||||||
state_top:
|
state_top:
|
||||||
base:
|
base:
|
||||||
|
|
Loading…
Reference in New Issue