Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
os_version:
- windows-2019
- windows-2022
- windows-2025
salt_state:
Expand All @@ -26,3 +25,40 @@ jobs:
salt-os-version: ${{ matrix.os_version }}
salt-state: ${{ matrix.salt_state }}
salt-pillar-root: ${{ matrix.salt_pillar_root }}

verify-shortcut-integration:
name: "Execute Salt Kitchen Integration Verification"
runs-on: "windows-2022"
steps:
- name: "Check Out Source Repository"
uses: "actions/checkout@v4"

- name: "Set Up Ruby Execution Environment"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "3.2"

- name: "Regenerate Dependency Lockfile with Full Index"
run: |
Remove-Item Gemfile.lock -Force -ErrorAction SilentlyContinue
bundle install --full-index
shell: "powershell"

- name: "Install Salt Minion Natively"
run: |
choco install saltminion -y
echo "C:\Program Files\Salt Project\Salt" >> $env:GITHUB_PATH
shell: "powershell"

- name: "Execute Converge and Verify Integration Tests"
run: |
bundle exec kitchen converge default
bundle exec kitchen verify default
shell: "powershell"

- if: "always()"
name: "Upload Test Kitchen Execution Logs"
uses: "actions/upload-artifact@v4"
with:
name: "kitchen-logs"
path: ".kitchen/logs/"
27 changes: 27 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

# This is a placeholder version to remind us to update the Gemfile
# when a new stable Chef Workstation is released
# renovate: chef-workstation 25.14.2

source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org')

# Install the `inspec` gem using `git` because versions after `4.22.22`
# suppress diff output; this version fixes this for our uses.
# rubocop:disable Layout/LineLength
gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf'
# rubocop:enable Layout/LineLength

# Install the `kitchen-docker` gem using `git` in order to avoid an upstream
# error caused by `kitchen-docker.gemspec`.
# TODO: correct the error upstream
# rubocop:disable Layout/LineLength
gem 'kitchen-docker', git: 'https://github.com/dafyddj/kitchen-docker', branch: 'chore/gemspec'
# rubocop:enable Layout/LineLength

gem 'kitchen-inspec', '3.1.0'
gem 'kitchen-salt', '0.7.2'

gem 'net-ssh', '7.3.2'

gem 'test-kitchen', '4.0.0'
13 changes: 8 additions & 5 deletions git-bash/_mapdata/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
} %}
{%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %}

{%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %}
{%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %}
{%- set output_dir = "C:\\temp" if grains.os_family == "Windows" else "/tmp" %}
{%- set output_file = output_dir ~ "\\salt_mapdata_dump.yaml"
if grains.os_family == "Windows"
else output_dir ~ "/salt_mapdata_dump.yaml" %}

{{ tplroot }}-mapdata-dump:
Dump Formula Map Data To File:
file.managed:
- context:
map: {{ _mapdata | yaml }}
- makedirs: true
- name: {{ output_file }}
- source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja
- template: jinja
- context:
map: {{ _mapdata | yaml }}
40 changes: 40 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
driver:
name: "exec"

provisioner:
formula: "git-bash"
log_level: "debug"
name: "salt_solo"
pillars_from_directories:
- "tests/pillar/git-bash"
require_chef: false
root_path: "C:\\salt_kitchen"
salt_copy_filter:
- ".kitchen"
- ".git"
salt_install: "none"

transport:
max_wait_until_ready: 60

verifier:
name: "inspec"
reporter:
- "cli"
root_path: "C:\\salt_kitchen"
sudo: true

platforms:
- name: "windows-2022"

suites:
- name: "default"
provisioner:
state_top:
base:
"*":
- "git-bash._mapdata"
- "git-bash"
Loading