From 8b7a927a0188b71242280d49ee65c622108a72d9 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Thu, 24 Jun 2021 09:16:39 +0100 Subject: [PATCH 1/2] ci: enable Vagrant-based testing using GitHub Actions * Automated using https://github.com/myii/ssf-formula/pull/334 --- .github/workflows/kitchen.vagrant.yml | 40 +++++++++++++++++++++ Gemfile | 4 +++ Gemfile.lock | 3 ++ kitchen.vagrant.yml | 52 +++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 .github/workflows/kitchen.vagrant.yml create mode 100644 kitchen.vagrant.yml diff --git a/.github/workflows/kitchen.vagrant.yml b/.github/workflows/kitchen.vagrant.yml new file mode 100644 index 0000000..cab6b25 --- /dev/null +++ b/.github/workflows/kitchen.vagrant.yml @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +name: 'Kitchen Vagrant (FreeBSD & OpenBSD)' +'on': ['push', 'pull_request'] + +env: + KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml' + +jobs: + test: + runs-on: 'macos-10.15' + strategy: + fail-fast: false + matrix: + instance: + - default-freebsd-130-master-py3 + - default-freebsd-122-master-py3 + - default-freebsd-114-master-py3 + # - default-freebsd-130-3002-6-py3 + # - default-freebsd-122-3002-6-py3 + # - default-freebsd-114-3002-6-py3 + - default-openbsd-69-3002-6-py3 + - default-openbsd-68-3001-1-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 }}' diff --git a/Gemfile b/Gemfile index c08ad6c..8be107e 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index d7cbc3b..ef26d96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -525,6 +527,7 @@ DEPENDENCIES kitchen-docker! kitchen-inspec (>= 2.2.1) kitchen-salt (>= 0.6.3) + kitchen-vagrant BUNDLED WITH 2.1.2 diff --git a/kitchen.vagrant.yml b/kitchen.vagrant.yml new file mode 100644 index 0000000..1dd2f44 --- /dev/null +++ b/kitchen.vagrant.yml @@ -0,0 +1,52 @@ +# -*- 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 + - name: openbsd-69-3002-6-py3 + driver: + box: myii/openbsd-6.9-3002.6-py3 + ssh: + shell: /bin/ksh + synced_folders: [] + - name: openbsd-68-3001-1-py3 + driver: + box: myii/openbsd-6.8-3001.1-py3 + ssh: + shell: /bin/ksh + synced_folders: [] From 53b5b39f250e82c04ff02e6e9a6b0d203349cb54 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Thu, 24 Jun 2021 09:25:51 +0100 Subject: [PATCH 2/2] fix(osfamilymap): fix no `grains.init` on *BSD Fixes #38. --- nfs/osfamilymap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs/osfamilymap.yaml b/nfs/osfamilymap.yaml index 008d913..1cf84fb 100644 --- a/nfs/osfamilymap.yaml +++ b/nfs/osfamilymap.yaml @@ -34,4 +34,4 @@ Suse: Gentoo: pkgs_server: ['net-fs/nfs-utils'] pkgs_client: ['net-fs/nfs-utils'] - service_name: {{ 'nfs-server' if grains.init == 'systemd' else 'nfs' }} + service_name: {{ 'nfs-server' if grains.get('init', '') == 'systemd' else 'nfs' }}