From 744fdc93d006ad32f80994b371c198e5a2a9deb6 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 27 Nov 2023 15:40:57 +0000 Subject: [PATCH] fix: Add New lint and publish workflows (#488) * fix: Add New lint and publish workflows --------- Signed-off-by: Dan Webb --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 9 ++++----- .github/workflows/lint.yml | 9 +++++++++ .github/workflows/linters.yml | 31 ------------------------------- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ .github/workflows/unit.yml | 23 ----------------------- .markdownlint.yaml | 8 ++++++++ .rubocop.yml | 11 +++++++++-- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ CODE_OF_CONDUCT.md | 4 +++- README.md | 17 ++++++++--------- 11 files changed, 105 insertions(+), 71 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/linters.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/unit.yml create mode 100644 .markdownlint.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b7175b0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +@test-kitchen/maintainers diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d9750e3..7062856 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,8 @@ --- +version: 2 updates: - - - directory: / - open-pull-requests-limit: 10 - package-ecosystem: bundler + - package-ecosystem: bundler + directory: "/" schedule: interval: daily -version: 2 + open-pull-requests-limit: 10 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0eaf511 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,9 @@ +--- +name: 'Test' + +'on': + pull_request: + +jobs: + lint-unit: + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml deleted file mode 100644 index b53356d..0000000 --- a/.github/workflows/linters.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: linters - -'on': - pull_request: - push: - branches: - - main - -jobs: - yamllint: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@main - - name: Run yaml Lint - uses: actionshub/yamllint@main - chefstyle: - runs-on: ubuntu-latest - strategy: - matrix: - ruby: ['2.7', '3.0', '3.1'] - name: Chefstyle on Ruby ${{ matrix.ruby }} - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - uses: r7kamura/rubocop-problem-matchers-action@v1 - - run: bundle exec chefstyle diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ae10b51 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +--- +"on": + push: + branches: + - main + +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: ruby + package-name: kitchen-vagrant + version-file: lib/kitchen/driver/vagrant_version.rb + 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 }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml deleted file mode 100644 index a8890c5..0000000 --- a/.github/workflows/unit.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Unit - -'on': - pull_request: - push: - branches: - - main - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - ruby: ['2.7', '3.0', '3.1'] - name: Unit test on Ruby ${{ matrix.ruby }} - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rake test diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..5df560a --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,8 @@ +default: true +MD013: false +MD024: false +MD026: false +MD036: false +MD012: false +MD029: false +MD004: false diff --git a/.rubocop.yml b/.rubocop.yml index f711649..46802c5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,10 @@ ---- +require: + - chefstyle + AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 + Include: + - "**/*.rb" + Exclude: + - "vendor/**/*" + - "spec/**/*" diff --git a/CHANGELOG.md b/CHANGELOG.md index ba8fa38..9d6f4b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,11 +52,13 @@ - Add a Code of Conduct file + misc testing updates [#442](https://github.com/test-kitchen/kitchen-vagrant/pull/442) ([@tas50](https://github.com/tas50)) ## [1.7.2](https://github.com/test-kitchen/kitchen-vagrant/tree/1.7.2) (2020-11-10) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.7.1...v1.7.2) - Ignore error if box not found when updating [#428](https://github.com/test-kitchen/kitchen-vagrant/pull/428) ([@clintoncwolfe](https://github.com/clintoncwolfe)) ## [1.7.1](https://github.com/test-kitchen/kitchen-vagrant/tree/1.7.1) (2020-11-03) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.7.0...v1.7.1) - Don't fail if active boxes can't be pruned [#427](https://github.com/test-kitchen/kitchen-vagrant/pull/427) ([@tas50](https://github.com/tas50)) @@ -65,38 +67,45 @@ - Optimize our requires to improve performance [#423](https://github.com/test-kitchen/kitchen-vagrant/pull/423) ([@tas50](https://github.com/tas50)) ## [1.7.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.7.0) (2020-07-04) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.6.1...v1.7.0) - Add new `box_auto_update` and `box_auto_prune` options to pull newer Vagrant base boxes [#421](https://github.com/test-kitchen/kitchen-vagrant/pull/421) ([@Stromweld](https://github.com/Stromweld)) ## [1.6.1](https://github.com/test-kitchen/kitchen-vagrant/tree/1.6.1) (2020-01-14) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.6.0...v1.6.1) - \[README\] fix openstack link [#409](https://github.com/test-kitchen/kitchen-vagrant/pull/409) ([@arthurlogilab](https://github.com/arthurlogilab)) - Use require_relative instead of require [#414](https://github.com/test-kitchen/kitchen-vagrant/pull/414) ([@tas50](https://github.com/tas50)) ## [1.6.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.6.0) (2019-08-05) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.5.2...v1.6.0) - Don't fail when instance names become too long for Hyper-V [#404](https://github.com/test-kitchen/kitchen-vagrant/pull/404) ([@Xorima](https://github.com/Xorima)) - Require Ruby 2.3 or later (Ruby < 2.3 are no longer supported Ruby releases) ## [1.5.2](https://github.com/test-kitchen/kitchen-vagrant/tree/1.5.2) (2019-05-02) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.5.1...v1.5.2) - Restores vm name uniqueness [#399](https://github.com/test-kitchen/kitchen-vagrant/pull/399) ([@fretb](https://github.com/fretb)) ## [1.5.1](https://github.com/test-kitchen/kitchen-vagrant/tree/1.5.1) (2019-03-19) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.5.0...v1.5.1) - Loosen the Test Kitchen dep to allow 2.0 [#398](https://github.com/test-kitchen/kitchen-vagrant/pull/398) ([@tas50](https://github.com/tas50)) ## [1.5.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.5.0) (2019-03-14) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.4.0...v1.5.0) - Support using bento/amazonlinux-2 when specifying just amazonlinux-2 platform [#397](https://github.com/test-kitchen/kitchen-vagrant/pull/397) ([@tas50](https://github.com/tas50)) ## [1.4.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.4.0) (2019-01-28) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.6...v1.4.0) - Add usage of vm_hostname to Readme.md [#386](https://github.com/test-kitchen/kitchen-vagrant/pull/386) ([@f9n](https://github.com/f9n)) @@ -104,6 +113,7 @@ - Added WSL support [#384](https://github.com/test-kitchen/kitchen-vagrant/pull/384) ([@BCarley](https://github.com/BCarley)) ## [1.3.6](https://github.com/test-kitchen/kitchen-vagrant/tree/1.3.6) (2018-10-26) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.5...v1.3.6) **Merged pull requests:** @@ -112,6 +122,7 @@ - Newest vagrant no long requires vagrant-winrm plugin [\#379](https://github.com/test-kitchen/kitchen-vagrant/pull/379) ([tyler-ball](https://github.com/tyler-ball)) ## [v1.3.5](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.3.5) (2018-10-23) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.4...v1.3.5) **Closed issues:** @@ -123,6 +134,7 @@ - Slim the size of the gem by removing spec files [\#377](https://github.com/test-kitchen/kitchen-vagrant/pull/377) ([tas50](https://github.com/tas50)) ## [v1.3.4](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.3.4) (2018-09-15) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.3...v1.3.4) **Merged pull requests:** @@ -131,6 +143,7 @@ - Vagrantfile Template: Hyper-v Differencing\_disk deprecation [\#370](https://github.com/test-kitchen/kitchen-vagrant/pull/370) ([cocazoulou](https://github.com/cocazoulou)) ## [v1.3.3](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.3.3) (2018-08-13) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.2...v1.3.3) **Closed issues:** @@ -148,6 +161,7 @@ - Fix disk examples [\#360](https://github.com/test-kitchen/kitchen-vagrant/pull/360) ([espoelstra](https://github.com/espoelstra)) ## [v1.3.2](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.3.2) (2018-04-23) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.1...v1.3.2) **Merged pull requests:** @@ -157,6 +171,7 @@ - Hyper-V: Ensure default switch name is always wrapped in quotes [\#345](https://github.com/test-kitchen/kitchen-vagrant/pull/345) ([stuartpreston](https://github.com/stuartpreston)) ## [v1.3.1](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.3.1) (2018-02-20) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.3.0...v1.3.1) **Merged pull requests:** @@ -164,22 +179,26 @@ - Adding support for HyperV Differencing\_disk [\#342](https://github.com/test-kitchen/kitchen-vagrant/pull/342) ([cocazoulou](https://github.com/cocazoulou)) ## [1.3.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.3.0) (2018-01-17) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.2.2...1.3.0) - Improve Hyper-V defaults and support [\#338](https://github.com/test-kitchen/kitchen-vagrant/pull/338) ## [1.2.2](https://github.com/test-kitchen/kitchen-vagrant/tree/1.2.2) (2017-11-07) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.2.1...1.2.2) - For WinRM options, only treat strings as strings. [\#330](https://github.com/test-kitchen/kitchen-vagrant/pull/330) ## [1.2.1](https://github.com/test-kitchen/kitchen-vagrant/tree/1.2.1) (2017-08-22) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.2.0...1.2.1) - Revert parallel virtualbox [\#325](https://github.com/test-kitchen/kitchen-vagrant/pull/325) - Shorten directory name for `vagrant_root` [\#323](https://github.com/test-kitchen/kitchen-vagrant/pull/323) ## [1.2.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.2.0) (2017-08-11) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.1.1...1.2.0) **Implemented enhancements:** @@ -188,6 +207,7 @@ - Parallel virtualbox [\#202](https://github.com/test-kitchen/kitchen-vagrant/pull/202) ([rveznaver](https://github.com/rveznaver)) ## [v1.1.1](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.1.1) (2017-07-26) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.1.0...v1.1.1) **Fixed Bugs** @@ -197,9 +217,11 @@ - Disable caching, even for bento boxes. [\#313](https://github.com/test-kitchen/kitchen-vagrant/pull/313) ([robbkidd](https://github.com/robbkidd)) ## [v1.1.0](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.1.0) (2017-03-31) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.0.2...v1.1.0) **New Features:** + - Make kitchen package work [\#275](https://github.com/test-kitchen/kitchen-vagrant/pull/275) ([ccope](https://github.com/ccope)) **Improvements:** @@ -210,6 +232,7 @@ - Add support for all misc vagrant providers [\#290](https://github.com/test-kitchen/kitchen-vagrant/pull/290) ([myoung34](https://github.com/myoung34)) ## [v1.0.2](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.0.2) (2017-02-13) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.0.1...v1.0.2) **Fixed bugs:** @@ -217,6 +240,7 @@ - Fixed a bug that can occur when `instance` returns `nil` [\#285](https://github.com/test-kitchen/kitchen-vagrant/pull/285) ([Kuniwak](https://github.com/Kuniwak)) ## [v1.0.1](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.0.1) (2017-02-10) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.0.0...v1.0.1) **Fixed bugs:** @@ -224,6 +248,7 @@ - Fixed cache folder disable for FreeBSD and MacOS/OSX [\#281](https://github.com/test-kitchen/kitchen-vagrant/pull/281) ([brentm5](https://github.com/brentm5)) [\#283](https://github.com/test-kitchen/kitchen-vagrant/pull/283) ([cheeseplus](https://github.com/cheeseplus)) ## [1.0.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.0.0) (2017-01-10) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.21.1...v1.0.0) **Implemented enhancements:** @@ -243,6 +268,7 @@ - Fix quoting for cloud providers \(redux \#179\) [\#268](https://github.com/test-kitchen/kitchen-vagrant/pull/268) ([cheeseplus](https://github.com/cheeseplus)) ## [0.21.1](https://github.com/test-kitchen/kitchen-vagrant/tree/0.21.1) (2016-12-05) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.21.0...v0.21.1) **Implemented enhancements:** @@ -259,6 +285,7 @@ - do not map the extra cache drive on non virtualbox windows [\#255](https://github.com/test-kitchen/kitchen-vagrant/pull/255) ([mwrock](https://github.com/mwrock)) ## [0.21.0](https://github.com/test-kitchen/kitchen-vagrant/tree/0.21.0) (2016-11-29) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.20.0...v0.21.0) **Fixed bugs:** @@ -275,6 +302,7 @@ - Add support for ovirt3 vagrant provider [\#223](https://github.com/test-kitchen/kitchen-vagrant/pull/223) ([xiboy](https://github.com/xiboy)) ## [0.20.0](https://github.com/test-kitchen/kitchen-vagrant/tree/v0.20.0) (2016-04-07) + [Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v0.19.0...v0.20.0) **Implemented enhancements:** diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 980c134..78dce8e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ -Please refer to the Chef Community Code of Conduct at https://www.chef.io/code-of-conduct/ +# Code of Conduct + +Please refer to the Chef Community Code of Conduct at diff --git a/README.md b/README.md index 66864cd..11543c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Kitchen::Vagrant +# Kitchen::Vagrant [![Gem Version](https://badge.fury.io/rb/kitchen-vagrant.svg)](http://badge.fury.io/rb/kitchen-vagrant) -![CI](https://github.com/test-kitchen/kitchen-vagrant/workflows/CI/badge.svg?branch=master) +[![CI](https://github.com/test-kitchen/kitchen-vagrant/actions/workflows/lint.yml/badge.svg)](https://github.com/test-kitchen/kitchen-vagrant/actions/workflows/lint.yml) A Test Kitchen Driver for Vagrant. @@ -10,13 +10,13 @@ sandboxed directory. Since the Vagrantfile is written out on disk, Vagrant needs absolutely no knowledge of Test Kitchen. So no Vagrant plugins are required. -## Requirements +## Requirements -### Vagrant +### Vagrant A Vagrant version of 1.6 or later. -## Installation +## Installation The kitchen-vagrant driver ships as part of Chef Workstation. The easiest way to use this driver is to [Download Chef Workstation](https://www.chef.io/downloads/tools/workstation). @@ -38,7 +38,7 @@ gem "kitchen-vagrant" See the [kitchen.ci Vagrant Driver Page](https://kitchen.ci/docs/drivers/vagrant/) for documentation on configuring this driver. -## Development +## Development * Source hosted at [GitHub][repo] * Report issues/questions/feature requests on [GitHub Issues][issues] @@ -53,15 +53,14 @@ example: 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request -## Authors +## Authors Created by [Fletcher Nichol][author] () -## License +## License Apache 2.0 (see [LICENSE][license]) - [author]: https://github.com/test-kitchen [issues]: https://github.com/test-kitchen/kitchen-vagrant/issues [license]: https://github.com/test-kitchen/kitchen-vagrant/blob/master/LICENSE