Skip to content

Update workflows to use artifact actions v4 and replace the archived workflow … #123

Update workflows to use artifact actions v4 and replace the archived workflow …

Update workflows to use artifact actions v4 and replace the archived workflow … #123

name: Verify the Baseline using Vagrant
on:
push:
branches: [ master, feature/** ]
pull_request:
branches: [ master, feature/** ]
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: ['vanilla', '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: '2.7'
- name: Disable ri and rdoc
run: 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
- name: Setup caching
uses: actions/cache@v4
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: Regenerate current `profile.json`
run: |
bundle exec inspec json . | jq . > profile.json
- name: Lint the Inspec profile
run: bundle exec inspec check .
- name: Run kitchen test - Couchbase Enterprise 6.0.2
run: bundle exec kitchen test --destroy=always ${{ matrix.suite }}-rhel-7-couchbase-602-enterprise || true
- name: Check Kitchen log
run: cat .kitchen/logs/kitchen.log
- name: Display our ${{ matrix.suite }} results summary - Couchbase Enterprise 6.0.2
run: bundle exec inspec_tools summary -j spec/results/rhel-7-couchbase-6.0.2-enterprise-${{ matrix.suite }}-test-result.json --json-counts | jq .
- name: Ensure the scan meets our ${{ matrix.suite }} results threshold - Couchbase Enterprise 6.0.2
run: bundle exec inspec_tools compliance -j spec/results/rhel-7-couchbase-6.0.2-enterprise-${{ matrix.suite }}-test-result.json -f threshold.${{ matrix.suite }}.yml
- name: Run kitchen test - Couchbase Enterprise 6.6.0
run: bundle exec kitchen test --destroy=always ${{ matrix.suite }}-rhel-7-couchbase-660-enterprise || true
- name: Check Kitchen log
run: cat .kitchen/logs/kitchen.log
- name: Display our ${{ matrix.suite }} results summary - Couchbase Enterprise 6.6.0
run: bundle exec inspec_tools summary -j spec/results/rhel-7-couchbase-6.6.0-enterprise-${{ matrix.suite }}-test-result.json --json-counts | jq .
- name: Ensure the scan meets our ${{ matrix.suite }} results threshold - Couchbase Enterprise 6.6.0
run: bundle exec inspec_tools compliance -j spec/results/rhel-7-couchbase-6.6.0-enterprise-${{ matrix.suite }}-test-result.json -f threshold.${{ matrix.suite }}.yml
- name: Save Test Result JSON
uses: actions/upload-artifact@v4
with:
path: spec/results