https://github.com/actionshub/test-kitchen
Repository for the actionshub-test-kitchen Github Action
https://github.com/actionshub/test-kitchen
action ci github-action terraform-managed test-kitchen
Last synced: over 1 year ago
JSON representation
Repository for the actionshub-test-kitchen Github Action
- Host: GitHub
- URL: https://github.com/actionshub/test-kitchen
- Owner: actionshub
- License: apache-2.0
- Created: 2020-04-19T08:56:21.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T13:49:51.000Z (about 2 years ago)
- Last Synced: 2024-05-29T06:00:57.689Z (about 2 years ago)
- Topics: action, ci, github-action, terraform-managed, test-kitchen
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/actionshub-test-kitchen
- Size: 123 KB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test-kitchen
[](https://opensource.org/licenses/Apache-2.0)
A Github Action to run Test Kitchen on your cookbooks
Note you will need to accept the Chef license, you can find more information at
## Usage
This example shows how to use dokken with this action to test linux servers
```yaml
name: kitchen
on: [pull_request]
jobs:
dokken:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- centos-7
- centos-8
suite: ['default']
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@main
- name: Install Chef
uses: actionshub/chef-install@main
- name: Test-Kitchen
uses: actionshub/test-kitchen@main
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
```
This example shows you how to use Macos with this action
This example uses seperate `converge` and `verify` actions
```yaml
name: kitchen
on: [pull_request]
jobs:
macos:
needs: [mdl, yamllint, delivery]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Install Chef
uses: actionshub/chef-install@main
- name: Kitchen Converge
uses: actionshub/test-kitchen@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.macos.yml
TERM: xterm-256color
with:
suite: adoptopenjdk-14
os: macos
action: converge
- name: Source Profile for JAVA_HOME
run: |
source /etc/profile
echo "sourced profile for JAVA_HOME"
echo "New JAVA home after Chef run is: ${JAVA_HOME}"
- name: Kitchen Verify
uses: actionshub/test-kitchen@master
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.macos.yml
TERM: xterm-256color
with:
suite: adoptopenjdk-14
os: macos
action: verify
working-directory: './cookbook'
```
## Input
We support the following Input Variables
|name| default| description|
|--- |------- |----------- |
|suite| | the name of the suite to run |
|os | | Which os to run on |
## Environment Variables
We recommend the following environment variables
|name| default| description|
|--- |------- |----------- |
|CHEF_LICENSE| | Set to `accept-no-persist` to accept the chef licensing rules |
|KITCHEN_LOCAL_YAML | | Can be used to megre in another yaml file for test-kitchen, eg `kitchen.dokken.yml` |