diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a83eec9..2e93d5e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,30 +1,76 @@ --- -name: 'Lint, Unit & Integration Tests' +name: lint -'on': +"on": pull_request: + push: + branches: + - main -jobs: - lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main +concurrency: + group: lint-${{ github.ref }} + cancel-in-progress: true - integration: +jobs: + chefstyle: + env: + BUNDLE_WITH: ${{ inputs.bundle_with }} runs-on: ubuntu-latest - needs: lint-unit - name: Kitchen Verify strategy: + fail-fast: false matrix: ruby: ["3.3"] + name: Chefstyle on Ruby steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - 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 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Create & Validate containers - run: | - bundle exec bundle exec kitchen create hello - bundle exec bundle exec kitchen test helloagain - bundle exec bundle exec kitchen destroy hello - env: - CHEF_LICENSE: "accept-no-persist" + - 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: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run yaml Lint + uses: actionshub/yamllint@main + + markdown-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Markdown lint + uses: DavidAnson/markdownlint-cli2-action@v16 + with: + globs: "**/*.md" + + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 + with: + use-quiet-mode: "yes" + use-verbose-mode: "yes" + check-modified-files-only: "yes" + base-branch: "main" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index d47a1b2..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -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 }} - - - name: Checkout - uses: actions/checkout@v4 - if: ${{ steps.release.outputs.release_created }} - - - name: Build and publish to GitHub Package - uses: actionshub/publish-gem-to-github@main - if: ${{ steps.release.outputs.release_created }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - owner: ${{ secrets.OWNER }} - - - name: Build and publish to RubyGems - uses: actionshub/publish-gem-to-rubygems@main - if: ${{ steps.release.outputs.release_created }} - with: - token: ${{ secrets.RUBYGEMS_API_KEY }}