Skip to content
name: Verify the Baseline using Vagrant
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types:
- published
jobs:
my-job:
name: Validate my profile
runs-on: macos-latest
env:
CHEF_LICENSE: accept-silent
KITCHEN_YAML: kitchen.vagrant.yml
strategy:
matrix:
suite: ['hardened']
fail-fast: false
steps:
- name: Add jq for output formatting
run: brew install jq
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Disable ri and rdoc
run: 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
- name: Setup caching
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle install
run: |
gem install bundler
bundle config path vendor/bundle
bundle install
- name: Run kitchen test
run: |
cd test/cookbooks/Win2019STIG
bundle exec kitchen test ${{ matrix.suite }} || true
- name: Save Test Result JSON
uses: actions/upload-artifact@v4
with:
path: test/cookbooks/Win2019STIG/results/*.json
- name: Display our ${{ matrix.suite }} results summary
uses: mitre/saf_action@v1
with:
command_string: 'view summary -i test/cookbooks/Win2019STIG/results/${{ matrix.suite }}-test-result.json'
- name: Ensure the scan meets our ${{ matrix.suite }} results threshold
uses: mitre/saf_action@v1
with:
command_string: 'validate threshold -i test/cookbooks/Win2019STIG/results/${{ matrix.suite }}-test-result.json -F test/cookbooks/Win2019STIG/${{ matrix.suite }}.threshold.yml'