Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add Renovate & update workflows #5

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 42 additions & 15 deletions .github/workflows/lint-unit.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,81 @@
name: Lint & Unit test

'on':
"on":
workflow_call:
inputs:
bundle_with:
description: "Bundle with option for Cookstyle, chose the bundler group that Cookstyle is in"
type: "string"
required: false
default: "cookstyle"
bundle_without:
description: "Bundle without the listed groups of Gems"
type: string
required: false
default: "development"

jobs:
chefstyle:
env:
BUNDLE_WITHOUT: integration
BUNDLE_WITH: ${{ inputs.bundle_with }}
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.1']
ruby: ["3.2"]
name: Chefstyle on Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1.161.0
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1.161.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: r7kamura/rubocop-problem-matchers-action@v1
- run: bundle exec chefstyle

- name: Chef Style
run: bundle exec chefstyle

yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
- name: Checkout code
uses: actions/checkout@v4

- name: Run yaml Lint
uses: actionshub/yamllint@main

mdl:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: Check out code
- name: Checkout code
uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v13

- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@v13
with:
globs: "**/*.md"

test:
name: Unit Test with Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
needs: [mdl, yamllint, chefstyle]
needs: [markdown-lint, yamllint, chefstyle]
env:
BUNDLE_WITHOUT: ${{ inputs.bundle_without }}
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1']
ruby: ["3.0", "3.1", "3.2"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1.161.0
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1.161.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake test

- name: Rake Test
run: bundle exec rake test
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Reusable Workflows

## Lint and Unit Test

- `.github/workflows/lint-unit.yml`

## Usage

Include the following in your workflow:

```yaml
jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
with:
bundle_with: "cookstyle"
bundle_without: "development"
```

The options above are the default values, so you can omit them if you want.
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", "schedule:automergeEarlyMondays"]
}