-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try individual cookbook Test Kitchen rule again
- Loading branch information
1 parent
edd94ea
commit 5396d2d
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |