Skip to content

Commit

Permalink
Try individual cookbook Test Kitchen rule again
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Aug 20, 2023
1 parent edd94ea commit 5396d2d
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: kitchen

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'cookbooks' output variable
cookbooks: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
with:
path: boxcutter-chef-cookbooks
- uses: dorny/paths-filter@v2
id: filter
with:
working-directory: boxcutter-chef-cookbooks
# Use context to get the branch where commits were pushed.
# If there is only one long-lived branch (e.g. main),
# you can specify it directly.
# If its not configured, the repository default branch is used.
base: ${{ github.ref }}
filters: |
cookbooks/boxcutter_python: 'cookbooks/boxcutter_python/**'
# Job to run pulumi projects
build:
needs: changes
strategy:
matrix:
# Parse JSON array containing names of all filters matching any of changed files
# e.g. ['image1', 'image2'] if both image folders contains changes
cookbook: ${{ fromJSON(needs.changes.outputs.cookbooks) }}
if: ${{ needs.changes.outputs.cookbooks != '[]' && needs.changes.outputs.cookbooks != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: boxcutter-chef-cookbooks
- name: Checkout chef-cookbooks repository
uses: actions/checkout@v3
with:
repository: boxcutter/chef-cookbooks
path: chef-cookbooks
- name: Install Chef
uses: actionshub/chef-install@main
with:
omnitruckUrl: omnitruck.cinc.sh
project: cinc-workstation
version: 23.7.1042
- name: Run Kitchen
working-directory: boxcutter-chef-cookbooks/${{ matrix.cookbook }}
run: |
kitchen test
env:
CHEF_LICENSE: accept-no-persist
CHEF_VERSION: 18.2.7

0 comments on commit 5396d2d

Please sign in to comment.