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

Add GitHub Actions workflows #393

Closed
wants to merge 14 commits into from
Closed
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: Lint & Unit

"on":
pull_request:
push:
branches:
- main

jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Lint YAML
uses: koozz/yamllint-action@main

chefstyle:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7"]
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

unit:
name: Unit test on Ruby ${{ matrix.ruby }}
needs: [yamllint, chefstyle]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7", "3.0", "3.1"]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake spec

integration-linux:
name: Integration test on Linux
runs-on: ubuntu-latest
needs: unit
strategy:
matrix:
ruby: ["2.7", "3.0", "3.1"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake spec

integration-windows:
name: Integration test on Windows
runs-on: windows-latest
needs: unit
strategy:
fail-fast: false
matrix:
suite: [default, context, capabilities, arm64, amd64, inspec]
os:
- amazonlinux-2
- ubuntu-18.04
- ubuntu-20.04
- fedora-latest
- centos-7
- centos-8
- oraclelinux-7
- rockylinux-8
- debian-9
- debian-10
- opensuse-15
- dockerfile
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
65 changes: 0 additions & 65 deletions .kitchen.yml

This file was deleted.

1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1
4 changes: 0 additions & 4 deletions .tailor

This file was deleted.

57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
extends: default
rules:
line-length:
max: 256
level: warning
document-start: disable
braces:
forbid: false
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
16 changes: 15 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec

group :integration do
gem "bundler"
gem "rake"
gem "countloc"
gem "rspec", "~> 3.4"
gem "rspec-its", "~> 1.3"
gem "fuubar", "~> 2.5"
gem "simplecov", "~> 0.22"
gem "codecov", "~> 0.0", ">= 0.2.0"
gem "kitchen-inspec", "~> 2.6"
gem "train", ">= 2.1", "< 4.0" # validate 4.x when it's released
gem "chefstyle"
end
27 changes: 9 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
require "bundler/gem_tasks"
require 'cane/rake_task'
require 'tailor/rake_task'

desc "Run cane to check quality metrics"
Cane::RakeTask.new do |cane|
cane.canefile = './.cane'
end

Tailor::RakeTask.new

desc "Display LOC stats"
task :stats do
Expand All @@ -16,9 +7,9 @@ task :stats do
end

desc "Run all quality tasks"
task :quality => [:cane, :tailor, :stats]
task quality: %i{stats}

task :default => [:quality]
task default: [:quality]

# begin
# require 'kitchen/rake_tasks'
Expand All @@ -28,15 +19,15 @@ task :default => [:quality]
# end

# Create the spec task.
require 'rspec/core/rake_task'
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec, :tag) do |t, args|
t.rspec_opts = [].tap do |a|
a << '--color'
a << "--format #{ENV['CI'] ? 'documentation' : 'Fuubar'}"
a << '--backtrace' if ENV['VERBOSE'] || ENV['DEBUG']
a << "--seed #{ENV['SEED']}" if ENV['SEED']
a << "--color"
a << "--format #{ENV["CI"] ? "documentation" : "Fuubar"}"
a << "--backtrace" if ENV["VERBOSE"] || ENV["DEBUG"]
a << "--seed #{ENV["SEED"]}" if ENV["SEED"]
a << "--tag #{args[:tag]}" if args[:tag]
a << "--default-path test"
a << '-I test/spec'
end.join(' ')
a << "-I test/spec"
end.join(" ")
end
40 changes: 11 additions & 29 deletions kitchen-docker.gemspec
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
lib = File.expand_path('../lib', __FILE__)
require "English"
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'kitchen/docker/docker_version'
require "kitchen/docker/docker_version"

Gem::Specification.new do |spec|
spec.name = 'kitchen-docker'
spec.name = "kitchen-docker"
spec.version = Kitchen::Docker::DOCKER_VERSION
spec.authors = ['Sean Porter']
spec.email = ['[email protected]']
spec.authors = ["Sean Porter"]
spec.email = ["[email protected]"]
spec.description = %q{A Docker Driver for Test Kitchen}
spec.summary = spec.description
spec.homepage = 'https://github.com/test-kitchen/kitchen-docker'
spec.license = 'Apache 2.0'
spec.homepage = "https://github.com/test-kitchen/kitchen-docker"
spec.license = "Apache 2.0"

spec.files = `git ls-files`.split($/)
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
spec.require_paths = ["lib"]

spec.add_dependency 'test-kitchen', '>= 1.0.0'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'

# Style checker gems.
spec.add_development_dependency 'cane'
spec.add_development_dependency 'tailor'
spec.add_development_dependency 'countloc'

# Unit testing gems.
spec.add_development_dependency 'rspec', '~> 3.2'
spec.add_development_dependency 'rspec-its', '~> 1.2'
spec.add_development_dependency 'fuubar', '~> 2.0'
spec.add_development_dependency 'simplecov', '~> 0.9'
spec.add_development_dependency 'codecov', '~> 0.0', '>= 0.0.2'

# Integration testing gems.
spec.add_development_dependency 'kitchen-inspec', '~> 2.0'
spec.add_development_dependency 'train', '>= 2.1', '< 4.0' # validate 4.x when it's released
spec.add_dependency "test-kitchen", ">= 1.0.0"
end
Loading
Loading