-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
8 changed files
with
68 additions
and
10 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,9 @@ | ||
--- | ||
name: Lint & Unit | ||
|
||
"on": | ||
pull_request: | ||
|
||
jobs: | ||
lint-unit: | ||
uses: ./.github/workflows/lint-unit.yml |
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 |
---|---|---|
@@ -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" | ||
|
@@ -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/[email protected] | ||
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: | ||
|
@@ -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: | ||
|
@@ -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/[email protected] | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
|
||
- name: Rake Test | ||
if: steps.check.outputs.gemfile == 'true' | ||
run: bundle exec rake test |
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,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 }} |
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,4 @@ | ||
--- | ||
default: true | ||
MD013: false | ||
MD041: false |
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,3 @@ | ||
{ | ||
".": "0.2.0" | ||
} |
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 @@ | ||
# CHANGELOG |
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,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" | ||
} |