Skip to content

Commit 0876f1b

Browse files
authored
Merge pull request #13 from test-kitchen/ruby-3.1-ci-modernization
feat!: require Ruby 3.2 and busser 0.9, adopt release-please
2 parents 24c2650 + 9ac2915 commit 0876f1b

21 files changed

Lines changed: 200 additions & 149 deletions

‎.cane‎

Whitespace-only changes.

‎.github/dependabot.yml‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: "Test"
3+
4+
"on":
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
# The default token is granted write access to most of the repository.
11+
# Nothing here needs more than the checkout.
12+
permissions:
13+
contents: read
14+
15+
# Supersede in-flight runs for a branch. Pull requests cancel freely, but
16+
# pushes to main do not: every commit on main should keep a build of its own.
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
21+
jobs:
22+
lint-unit:
23+
# Pinned to a commit rather than @main so an upstream edit cannot reach
24+
# this repository's CI without a reviewed pull request. The trailing
25+
# comment names the release the commit belongs to, which is what lets
26+
# Renovate track the pin by version and keep both in step.
27+
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@95ef7803cf23aae5ee68593de5b7e0a731c1a929 # v0.4.0
28+
with:
29+
# This gem requires Ruby 3.2, and so do busser 0.9 and cucumber 11.
30+
# Without this the shared workflow would still start a Ruby 3.1 job and
31+
# bundler would refuse to resolve there.
32+
ruby_versions: '["3.2", "3.3", "3.4", "4.0"]'

‎.github/workflows/pr-title.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: "PR Title"
3+
4+
"on":
5+
pull_request_target:
6+
types: [opened, edited, reopened, synchronize]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
conventional-title:
13+
name: "Conventional commit title"
14+
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: read
17+
steps:
18+
# Pull requests here are squash merged, so the pull request title becomes
19+
# the commit subject on main. That makes the title the one place worth
20+
# checking: release-please reads those subjects to decide the next
21+
# version and to build the changelog.
22+
#
23+
# pull_request_target is used so the check also runs for pull requests
24+
# from forks. No repository code is checked out in this job, so none of
25+
# the usual pull_request_target risk applies.
26+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/publish.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: "Release"
3+
4+
"on":
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write # tag the release and commit the version bump
16+
pull-requests: write # open and update the release pull request
17+
packages: write # push the gem to GitHub Packages
18+
steps:
19+
# Opens and maintains a release pull request. Merging that pull request
20+
# is what actually cuts a release, so every step below is skipped until
21+
# release_created is set.
22+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
23+
id: release
24+
with:
25+
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
26+
27+
- name: Checkout code
28+
if: ${{ steps.release.outputs.release_created }}
29+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
31+
# These two steps are handed publishing credentials, so they are pinned
32+
# to a commit rather than a branch. A floating ref would let whoever
33+
# controls that branch run code with a token that can push this gem.
34+
- name: Publish to GitHub Packages
35+
if: ${{ steps.release.outputs.release_created }}
36+
uses: actionshub/publish-gem-to-github@86eb0ce1ced1072298bf68776a32a5c9703ad9aa # v1.0.13
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
owner: ${{ github.repository_owner }}
40+
41+
- name: Publish to RubyGems
42+
if: ${{ steps.release.outputs.release_created }}
43+
uses: actionshub/publish-gem-to-rubygems@f9126f7a2d36a4fd31a13e78fde5fbdcc4b7b251 # v2.0.6
44+
with:
45+
token: ${{ secrets.RUBYGEMS_API_KEY }}

‎.markdownlint.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
default: true
3+
MD004: false
4+
MD012: false
5+
MD013: false
6+
MD024: false

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.4"
3+
}

‎.rubocop.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
require:
3+
- cookstyle/chefstyle
4+
5+
AllCops:
6+
TargetRubyVersion: 3.1
7+
Exclude:
8+
- "vendor/**/*"
9+
- "spec/**/*"
10+
111
Style/ClassAndModuleChildren:
212
Exclude:
313
- lib/busser/runner_plugin/bash.rb

‎.simplecov‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
SimpleCov.profiles.define 'gem' do
2-
command_name 'Specs'
1+
SimpleCov.profiles.define "gem" do
2+
command_name "Specs"
33

4-
add_filter '.gem/'
5-
add_filter '/spec/'
6-
add_filter '/lib/vendor/'
4+
add_filter ".gem/"
5+
add_filter "/spec/"
6+
add_filter "/lib/vendor/"
77

8-
add_group 'Libraries', '/lib/'
8+
add_group "Libraries", "/lib/"
99
end
10-
SimpleCov.start 'gem'
10+
SimpleCov.start "gem"

‎.travis.yml‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)