Skip to content

Commit

Permalink
ci: enable Vagrant-based testing using GitHub Actions
Browse files Browse the repository at this point in the history
* Semi-automated using myii/ssf-formula#305
  • Loading branch information
myii committed Apr 19, 2021
1 parent 199683e commit 5c5de01
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/kitchen.vagrant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: 'Kitchen Vagrant (FreeBSD)'
'on': ['push', 'pull_request']

env:
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'

jobs:
test:
runs-on: 'macos-10.15'
strategy:
fail-fast: false
matrix:
instance:
# - prod-server-freebsd-130-master-py3
- freebsd-130-master-py3
# - prod-server-freebsd-122-master-py3
- freebsd-122-master-py3
# - prod-server-freebsd-114-master-py3
- freebsd-114-master-py3
# - prod-server-freebsd-130-3002-6-py3
# - prod-server-freebsd-122-3002-6-py3
# - prod-server-freebsd-114-3002-6-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 }}'
5 changes: 4 additions & 1 deletion .salt-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# vim: ft=yaml
---
exclude_paths: []
rules: {}
rules:
204: # Lines should be no longer that 160 chars
ignore: |
vault/files/vault.service.fbsd.j2
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure
# rubocop:enable Layout/LineLength
gem 'kitchen-inspec', '>= 2.2.1'
gem 'kitchen-salt', '>= 0.6.3'

group :vagrant do
gem 'kitchen-vagrant'
end
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ GEM
kitchen-salt (0.6.3)
hashie (>= 3.5)
test-kitchen (>= 1.4)
kitchen-vagrant (1.7.0)
test-kitchen (>= 1.4, < 3)
libyajl2 (1.2.0)
license-acceptance (1.0.19)
pastel (~> 0.7)
Expand Down Expand Up @@ -525,6 +527,7 @@ DEPENDENCIES
kitchen-docker!
kitchen-inspec (>= 2.2.1)
kitchen-salt (>= 0.6.3)
kitchen-vagrant

BUNDLED WITH
2.1.2
40 changes: 40 additions & 0 deletions kitchen.vagrant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
driver:
name: vagrant
cache_directory: false
customize:
usbxhci: 'off'
gui: false
ssh:
shell: /bin/sh
<% unless ENV['CI'] %>
linked_clone: true
synced_folders:
- - '.kitchen/kitchen-vagrant/%{instance_name}/vagrant'
- '/vagrant'
- 'create: true, disabled: false'
<% end %>

platforms:
- name: freebsd-130-master-py3
driver:
box: myii/freebsd-13.0-master-py3
synced_folders: [] # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255208
- name: freebsd-122-master-py3
driver:
box: myii/freebsd-12.2-master-py3
- name: freebsd-114-master-py3
driver:
box: myii/freebsd-11.4-master-py3
- name: freebsd-130-3002-6-py3
driver:
box: myii/freebsd-13.0-3002.6-py3
synced_folders: [] # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255208
- name: freebsd-122-3002-6-py3
driver:
box: myii/freebsd-12.2-3002.6-py3
- name: freebsd-114-3002-6-py3
driver:
box: myii/freebsd-11.4-3002.6-py3

0 comments on commit 5c5de01

Please sign in to comment.