Skip to content

Commit c79ce9a

Browse files
committed
ci: enable Vagrant-based testing using GitHub Actions
* Semi-automated using myii/ssf-formula#308
1 parent 4cd351a commit c79ce9a

File tree

7 files changed

+107
-16
lines changed

7 files changed

+107
-16
lines changed

.github/workflows/kitchen.vagrant.yml

+36
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 }}'

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ repos:
1717
stages: [manual]
1818
additional_dependencies: ['@commitlint/[email protected]']
1919
always_run: true
20+
- repo: https://github.com./rubocop-hq/rubocop
21+
rev: v1.9.1
22+
hooks:
23+
- id: rubocop
24+
name: Check Ruby files with rubocop
25+
args: [--debug]
26+
always_run: true
27+
pass_filenames: false
2028
- repo: https://github.com./shellcheck-py/shellcheck-py
2129
rev: v0.7.1.1
2230
hooks:

.travis.yml

+5-16
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,14 @@ stages:
3636
# - name: 'release'
3737
# if: 'branch = master AND type != pull_request'
3838
jobs:
39-
allow_failures:
40-
- env: Lint_rubocop
41-
fast_finish: true
4239
include:
4340
## Define the test stage that runs the linters (and testing matrix, if applicable)
4441

45-
# Run all of the linters in a single job (except `rubocop`)
42+
# Run all of the linters in a single job
4643
- language: 'node_js'
4744
node_js: 'lts/*'
4845
env: 'Lint'
49-
name: 'Lint: salt-lint, yamllint, shellcheck & commitlint'
46+
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
5047
before_install: 'skip'
5148
script:
5249
# Install and run `salt-lint`
@@ -57,6 +54,9 @@ jobs:
5754
# Need at least `v1.17.0` for the `yaml-files` setting
5855
- pip install --user yamllint>=1.17.0
5956
- yamllint -s .
57+
# Install and run `rubocop`
58+
- gem install rubocop
59+
- rubocop -d
6060
# Run `shellcheck` (already pre-installed in Travis)
6161
- shellcheck --version
6262
- git ls-files -- '*.sh' '*.bash' '*.ksh'
@@ -65,17 +65,6 @@ jobs:
6565
- npm i -D @commitlint/config-conventional
6666
@commitlint/travis-cli
6767
- commitlint-travis
68-
# Run the `rubocop` linter in a separate job that is allowed to fail
69-
# Once these lint errors are fixed, this can be merged into a single job
70-
- language: node_js
71-
node_js: lts/*
72-
env: Lint_rubocop
73-
name: 'Lint: rubocop'
74-
before_install: skip
75-
script:
76-
# Install and run `rubocop`
77-
- gem install rubocop
78-
- rubocop -d
7968

8069
# Run `pre-commit` linters in a single job
8170
- language: 'python'

Gemfile

+4
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

+3
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

+23
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

kitchen.yml

+28
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,41 @@ suites:
326326
- path: test/integration/default
327327
- name: passenger
328328
includes:
329+
- debian-10-tiamat-py3
330+
- debian-9-tiamat-py3
331+
- ubuntu-2004-tiamat-py3
332+
- ubuntu-1804-tiamat-py3
333+
- centos-8-tiamat-py3
334+
- centos-7-tiamat-py3
335+
- oraclelinux-8-tiamat-py3
329336
- debian-10-master-py3
330337
- debian-9-master-py3
331338
- ubuntu-2004-master-py3
332339
- ubuntu-1804-master-py3
333340
- centos-8-master-py3
334341
- centos-7-master-py3
335342
- oraclelinux-8-master-py3
343+
- debian-10-3002-5-py3
344+
- debian-9-3002-5-py3
345+
- ubuntu-2004-3002-5-py3
346+
- ubuntu-1804-3002-5-py3
347+
- centos-8-3002-5-py3
348+
- centos-7-3002-5-py3
349+
- oraclelinux-8-3002-5-py3
350+
- debian-10-3001-6-py3
351+
- debian-9-3001-6-py3
352+
- ubuntu-2004-3001-6-py3
353+
- ubuntu-1804-3001-6-py3
354+
- centos-8-3001-6-py3
355+
- centos-7-3001-6-py3
356+
- oraclelinux-8-3001-6-py3
357+
- debian-10-3000-8-py3
358+
- debian-9-3000-8-py3
359+
- ubuntu-1804-3000-8-py3
360+
- centos-8-3000-8-py3
361+
- centos-7-3000-8-py3
362+
- oraclelinux-8-3000-8-py3
363+
- ubuntu-1804-3000-8-py2
336364
provisioner:
337365
state_top:
338366
base:

0 commit comments

Comments
 (0)