Skip to content

Commit

Permalink
Fix: Add Renovate & update workflows (#5)
Browse files Browse the repository at this point in the history
- Update workflows
- Give them nice names!
- Add with and without bundler options

Signed-off-by: Dan Webb <dan.webb@damacus.io>
  • Loading branch information
damacus committed Nov 27, 2023
1 parent 1b5e115 commit 28378ca
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 15 deletions.
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"]
}

0 comments on commit 28378ca

Please sign in to comment.