mirror of
https://github.com/saltstack-formulas/salt-formula.git
synced 2026-07-23 10:05:22 +02:00
ci: enable Vagrant-based testing using GitHub Actions
* Semi-automated using https://github.com/myii/ssf-formula/pull/304
This commit is contained in:
@@ -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)'
|
||||
|
||||
'on': [push, pull_request]
|
||||
'on': ['push', 'pull_request']
|
||||
|
||||
env:
|
||||
machine_user: kitchen
|
||||
machine_pass: Pass@word1
|
||||
machine_port: 5985
|
||||
KITCHEN_LOCAL_YAML: kitchen.windows.yml
|
||||
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
test-2019:
|
||||
runs-on: 'windows-2019'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
instance:
|
||||
- v3002-py3-windows-2019-latest-py3
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
- name: 'Check out code'
|
||||
uses: 'actions/checkout@v2'
|
||||
- name: 'Install Chef'
|
||||
uses: 'actionshub/chef-install@1.1.0'
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
- shell: powershell
|
||||
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
|
||||
- shell: powershell
|
||||
- name: 'Set up WinRM'
|
||||
run: >
|
||||
Set-WSManQuickConfig -Force;
|
||||
Set-WSManInstance -ResourceURI winrm/config/service
|
||||
-ValueSet @{AllowUnencrypted="true"}
|
||||
- run: gem install bundler --quiet --no-document
|
||||
- name: Bundle install
|
||||
- name: 'Run Bundler'
|
||||
run: |
|
||||
ruby --version
|
||||
bundle config path vendor/bundle
|
||||
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 }}'
|
||||
|
||||
Reference in New Issue
Block a user