Skip to content

Commit 16ec625

Browse files
committed
ci: enable Vagrant-based testing using GitHub Actions
* Semi-automated using myii/ssf-formula#305
1 parent 94797f2 commit 16ec625

File tree

5 files changed

+81
-1
lines changed

5 files changed

+81
-1
lines changed

.github/workflows/kitchen.vagrant.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
name: 'Kitchen Vagrant (FreeBSD)'
5+
'on': ['push', 'pull_request']
6+
7+
env:
8+
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'
9+
10+
jobs:
11+
test:
12+
runs-on: 'macos-10.15'
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
instance:
17+
# - prod-server-freebsd-130-master-py3
18+
- freebsd-130-master-py3
19+
# - prod-server-freebsd-123-master-py3
20+
- freebsd-123-master-py3
21+
# - prod-server-freebsd-130-3004-0-py3
22+
# - prod-server-freebsd-123-3004-0-py3
23+
steps:
24+
- name: 'Check out code'
25+
uses: 'actions/checkout@v2'
26+
- name: 'Set up Bundler cache'
27+
uses: 'actions/cache@v1'
28+
with:
29+
path: 'vendor/bundle'
30+
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
31+
restore-keys: "${{ runner.os }}-gems-"
32+
- name: 'Run Bundler'
33+
run: |
34+
ruby --version
35+
bundle config path vendor/bundle
36+
bundle install --jobs 4 --retry 3
37+
- name: 'Run Test Kitchen'
38+
run: 'bundle exec kitchen verify ${{ matrix.instance }}'

.salt-lint

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# vim: ft=yaml
33
---
44
exclude_paths: []
5-
rules: {}
5+
rules:
6+
204: # Lines should be no longer that 160 chars
7+
ignore: |
8+
vault/files/vault.service.fbsd.j2
69
skip_list:
710
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
811
- 205 # Use ".sls" as a Salt State file extension

Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure
1717

1818
gem 'kitchen-inspec', '>= 2.5.0'
1919
gem 'kitchen-salt', '>= 0.7.2'
20+
21+
group :vagrant do
22+
gem 'kitchen-vagrant'
23+
end

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ GEM
387387
kitchen-salt (0.7.2)
388388
hashie (>= 3.5)
389389
test-kitchen (>= 1.4)
390+
kitchen-vagrant (1.11.0)
391+
test-kitchen (>= 1.4, < 4)
390392
license-acceptance (2.1.13)
391393
pastel (~> 0.7)
392394
tomlrb (>= 1.2, < 3.0)
@@ -669,6 +671,7 @@ DEPENDENCIES
669671
kitchen-docker!
670672
kitchen-inspec (>= 2.5.0)
671673
kitchen-salt (>= 0.7.2)
674+
kitchen-vagrant
672675

673676
BUNDLED WITH
674677
2.1.2

kitchen.vagrant.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
driver:
5+
name: vagrant
6+
cache_directory: false
7+
customize:
8+
usbxhci: 'off'
9+
gui: false
10+
ssh:
11+
shell: /bin/sh
12+
<% unless ENV['CI'] %>
13+
linked_clone: true
14+
synced_folders:
15+
- - '.kitchen/kitchen-vagrant/%{instance_name}/vagrant'
16+
- '/vagrant'
17+
- 'create: true, disabled: false'
18+
<% end %>
19+
20+
platforms:
21+
- name: freebsd-130-master-py3
22+
driver:
23+
box: myii/freebsd-13.0-master-py3
24+
- name: freebsd-123-master-py3
25+
driver:
26+
box: myii/freebsd-12.3-master-py3
27+
- name: freebsd-130-3004-0-py3
28+
driver:
29+
box: myii/freebsd-13.0-3004.0-py3
30+
- name: freebsd-123-3004-0-py3
31+
driver:
32+
box: myii/freebsd-12.3-3004.0-py3

0 commit comments

Comments
 (0)