Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add workflows #123

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ name: 'Test'

jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2
34 changes: 34 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: release-please

"on":
push:
branches: [main]

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-google
version-file: lib/kitchen/driver/gce_version.rb

- 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 }}
7 changes: 5 additions & 2 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
MD012: false
default: true

Check warning on line 1 in .markdownlint.yaml

View workflow job for this annotation

GitHub Actions / lint-unit / yamllint

1:1 [document-start] missing document start "---"
MD013: false
MD024: false
MD026: false
MD036: false
MD012: false
MD029: false
MD004: false
1 change: 0 additions & 1 deletion .mdlrc

This file was deleted.

10 changes: 9 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
require:
- chefstyle

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
- "vendor/**/*"
- "spec/**/*"
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source "https://rubygems.org"

# Specify your gem's dependencies in kitchen-google.gemspec
gemspec

group :test do
Expand Down
8 changes: 4 additions & 4 deletions kitchen-google.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Gem::Specification.new do |s|
s.version = Kitchen::Driver::GCE_VERSION
s.summary = "Kitchen::Driver::Gce"
s.description = "A Test-Kitchen driver for Google Compute Engine"
s.authors = ["Andrew Leonard", "Chef Partner Engineering"]
s.email = ["[email protected]", "[email protected]"]
s.authors = ["Test Kitchen Team"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/test-kitchen/kitchen-google"
s.license = "Apache-2.0"

Expand All @@ -16,7 +16,7 @@ Gem::Specification.new do |s|

s.add_dependency "gcewinpass", "~> 1.1"
s.add_dependency "google-api-client", ">= 0.23.9", "<= 0.54.0"
s.add_dependency "test-kitchen", ">= 1.4.1"
s.add_dependency "test-kitchen", ">= 1.0.0", "< 4.0"

s.required_ruby_version = ">= 2.7"
s.required_ruby_version = ">= 3.1"
end
8 changes: 4 additions & 4 deletions lib/kitchen/driver/gce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Gce < Kitchen::Driver::Base
default_config :metadata, {}
default_config :labels, {}

DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/.freeze
DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/

def name
"Google Compute (GCE)"
Expand Down Expand Up @@ -272,11 +272,11 @@ def update_windows_password(server_name)
info("Resetting the Windows password for user #{username} on #{server_name}...")

state[:password] = GoogleComputeWindowsPassword.new(
project: project,
zone: zone,
project:,
zone:,
instance_name: server_name,
email: config[:email],
username: username
username:
).new_password

info("Password reset complete on #{server_name} complete.")
Expand Down
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":disableDependencyDashboard",
"schedule:automergeEarlyMondays"
]
}