Skip to content

Commit

Permalink
Update lint-unit.yml (#13)
Browse files Browse the repository at this point in the history
Add checks to skip tests that require Gemfile and no gemfile exists in the repo
Add googleapis/release-please-action pulish.yml workflow

---------

Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
  • Loading branch information
Stromweld authored Jun 18, 2024
1 parent bf722e6 commit 22d5d8c
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Lint & Unit

"on":
pull_request:

jobs:
lint-unit:
uses: ./.github/workflows/lint-unit.yml
35 changes: 26 additions & 9 deletions .github/workflows/lint-unit.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Lint & Unit test

"on":
workflow_call:
inputs:
bundle_with:
description: "Bundle with option for Chefstyle, chose the bundler group that Chefstyle is in"
description: "Chose the bundler group name that Chefstyle is in"
type: "string"
required: false
default: "chefstyle"
Expand All @@ -22,20 +23,28 @@ jobs:
strategy:
matrix:
ruby: ["3.3"]
name: Chefstyle on Ruby ${{ matrix.ruby }}
name: Chefstyle on Ruby
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for Gemfile
id: check
run: |
if [ -f Gemfile ]; then
echo "gemfile=true" >> $GITHUB_OUTPUT
else
echo "gemfile=false" >> $GITHUB_OUTPUT
fi
- name: Setup Ruby
if: steps.check.outputs.gemfile == 'true'
uses: ruby/setup-ruby@v1.180.1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: r7kamura/rubocop-problem-matchers-action@v1

if: steps.check.outputs.gemfile == 'true'
- name: Chef Style
if: steps.check.outputs.gemfile == 'true'
run: bundle exec chefstyle

yamllint:
Expand All @@ -59,9 +68,9 @@ jobs:
globs: "**/*.md"

test:
name: Unit Test with Ruby ${{ matrix.ruby }}
name: Unit Test with Ruby
runs-on: ubuntu-latest
needs: [markdown-lint, yamllint, chefstyle]
needs: [yamllint, chefstyle]
env:
BUNDLE_WITHOUT: ${{ inputs.bundle_without }}
strategy:
Expand All @@ -70,12 +79,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for Gemfile
id: check
run: |
if [ -f Gemfile ]; then
echo "gemfile=true" >> $GITHUB_OUTPUT
else
echo "gemfile=false" >> $GITHUB_OUTPUT
fi
- name: Setup Ruby
if: steps.check.outputs.gemfile == 'true'
uses: ruby/setup-ruby@v1.180.1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Rake Test
if: steps.check.outputs.gemfile == 'true'
run: bundle exec rake test
15 changes: 15 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: release-please

"on":
push:
branches: [main]

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
default: true
MD013: false
MD041: false
1 change: 0 additions & 1 deletion .mdlrc

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.2.0"
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CHANGELOG
10 changes: 10 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "simple",
"include-component-in-tag": false,
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 22d5d8c

Please # to comment.