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

fix: Add initial files for testing GitHub Actions #2

Merged
merged 4 commits into from
Nov 21, 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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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: Run yaml Lint
uses: actionshub/yamllint@main

chefstyle:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
ruby: ["3.1"]
name: Chefstyle on Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: r7kamura/rubocop-problem-matchers-action@v1
- run: bundle exec chefstyle

# Normally we would enable this but this is a stub gem without any code

Check warning on line 35 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / yamllint

35:3 [comments-indentation] comment not indented like content
# unit:
# name: Unit test on Ruby ${{ matrix.ruby }}
# needs: [yamllint, chefstyle]
# runs-on: ubuntu-latest
# strategy:
# matrix:
# ruby: ["3.1"]
# steps:
# - uses: actions/checkout@v4
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ matrix.ruby }}
# bundler-cache: true
# - run: bundle exec rake spec
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
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: workflow-testing-gem
version-file: lib/kitchen/driver/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@master
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 }}
env:
token: ${{ secrets.RUBYGEMS_TOKEN }}
owner: ${{ secrets.OWNER }}
5 changes: 5 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
MD012: false
MD013: false
MD024: false
MD036: false
9 changes: 9 additions & 0 deletions .rubocop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require: [chefstyle]

Check warning on line 1 in .rubocop.yaml

View workflow job for this annotation

GitHub Actions / yamllint

1:1 [document-start] missing document start "---"

AllCops:
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
- "vendor/**/*"
- "spec/**/*"
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec

group :chefstyle do
gem "chefstyle", "2.2.2"
end
42 changes: 42 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
PATH
remote: .
specs:
workflow-testing (0.0.1)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
chefstyle (2.2.2)
rubocop (= 1.25.1)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
racc (1.7.3)
rainbow (3.1.1)
regexp_parser (2.8.2)
rexml (3.2.6)
rubocop (1.25.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
unicode-display_width (2.5.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
chefstyle (= 2.2.2)
workflow-testing!

BUNDLED WITH
2.4.10
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# workflow-testing-gem

Gem repo for testing GitHub Actions release workflows
7 changes: 7 additions & 0 deletions lib/kitchen/driver/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module Kitchen
module Driver
WORKFLOW_TESTING_VERSION = "0.0.1"
end
end
17 changes: 17 additions & 0 deletions workflow-testing.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "kitchen/driver/version"

Gem::Specification.new do |spec|
spec.name = "workflow-testing"
spec.version = Kitchen::Driver::WORKFLOW_TESTING_VERSION
spec.authors = ["Dan Webb"]
spec.email = ["@gmail.com"]
spec.description = "A stub gem to test workflows"
spec.summary = spec.description
spec.homepage = "https://github.com/test-kitchen/workflow-testing-gem"
spec.license = "Apache-2.0"

spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.require_paths = ["lib"]
end