diff --git a/.github/workflows/lint-unit.yml b/.github/workflows/lint-unit.yml index 12f5269..7a586f8 100644 --- a/.github/workflows/lint-unit.yml +++ b/.github/workflows/lint-unit.yml @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..36436ba --- /dev/null +++ b/README.md @@ -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. diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7bbf482 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended", "schedule:automergeEarlyMondays"] +}