Skip to content

Commit 6e094e2

Browse files
committed
ci: enable Vagrant-based testing using GitHub Actions
* Semi-automated using myii/ssf-formula#309
1 parent bc9aa78 commit 6e094e2

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

.github/workflows/kitchen.vagrant.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
# - default-freebsd-122-latest-py3
18+
- freebsd-122-latest-py3
19+
# - default-freebsd-114-latest-py3
20+
- freebsd-114-latest-py3
21+
steps:
22+
- name: 'Check out code'
23+
uses: 'actions/checkout@v2'
24+
- name: 'Set up Bundler cache'
25+
uses: 'actions/cache@v1'
26+
with:
27+
path: 'vendor/bundle'
28+
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
29+
restore-keys: "${{ runner.os }}-gems-"
30+
- name: 'Run Bundler'
31+
run: |
32+
ruby --version
33+
bundle config path vendor/bundle
34+
bundle install --jobs 4 --retry 3
35+
- name: 'Run Test Kitchen'
36+
run: 'bundle exec kitchen verify ${{ matrix.instance }}'

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure
1212
# rubocop:enable Layout/LineLength
1313
gem 'kitchen-inspec', '>= 2.2.1'
1414
gem 'kitchen-salt', '>= 0.6.3'
15+
16+
group :vagrant do
17+
gem 'kitchen-vagrant'
18+
end

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ GEM
292292
kitchen-salt (0.6.3)
293293
hashie (>= 3.5)
294294
test-kitchen (>= 1.4)
295+
kitchen-vagrant (1.7.0)
296+
test-kitchen (>= 1.4, < 3)
295297
libyajl2 (1.2.0)
296298
license-acceptance (1.0.19)
297299
pastel (~> 0.7)
@@ -525,6 +527,7 @@ DEPENDENCIES
525527
kitchen-docker!
526528
kitchen-inspec (>= 2.2.1)
527529
kitchen-salt (>= 0.6.3)
530+
kitchen-vagrant
528531

529532
BUNDLED WITH
530533
2.1.2

kitchen.vagrant.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
linked_clone: true
11+
ssh:
12+
shell: /bin/sh
13+
14+
platforms:
15+
- name: freebsd-122-latest-py3
16+
driver:
17+
box: bento/freebsd-12.2
18+
- name: freebsd-114-latest-py3
19+
driver:
20+
box: bento/freebsd-11.4
21+
22+
provisioner:
23+
salt_install: bootstrap

0 commit comments

Comments
 (0)