Skip to content

Commit

Permalink
Merge pull request #2 from voxpupuli/updates
Browse files Browse the repository at this point in the history
Apply Vox Pupuli CI + RuboCop defaults
  • Loading branch information
bastelfreak authored Feb 7, 2025
2 parents 794c7ce + 0a49114 commit 5a82457
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 275 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
# raise PRs for gem updates
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'voxpupuli'
steps:
- uses: actions/checkout@v4
- name: Install Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
env:
BUNDLE_WITHOUT: release
- name: Build gem
run: gem build --strict --verbose *.gemspec
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

on:
pull_request: {}
push:
branches:
- master

env:
BUNDLE_WITHOUT: release

jobs:
rubocop_and_matrix:
runs-on: ubuntu-latest
outputs:
ruby: ${{ steps.ruby.outputs.versions }}
steps:
- uses: actions/checkout@v4
- name: Install Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Run RuboCop
run: bundle exec rake rubocop
- id: ruby
uses: voxpupuli/ruby-version@v1

test:
name: "Ruby ${{ matrix.ruby }}"
runs-on: ubuntu-latest
needs: rubocop_and_matrix
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Build the gem
run: gem build --strict --verbose *.gemspec

tests:
needs:
- test
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.bundle
.vendor
vendor
Gemfile.lock
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
inherit_from: .rubocop_todo.yml

inherit_gem:
voxpupuli-rubocop: rubocop.yml
32 changes: 32 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2025-02-06 09:54:26 UTC using RuboCop version 1.67.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/puppet-lint/plugins/check_exec_idempotency/check_exec_idempotency_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- '**/spec/features/**/*'
- '**/spec/requests/**/*'
- '**/spec/routing/**/*'
- '**/spec/system/**/*'
- '**/spec/views/**/*'
- 'spec/puppet-lint/plugins/check_exec_idempotency/check_exec_idempotency_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 148
13 changes: 0 additions & 13 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,3 @@ group :release do
gem 'faraday-retry', '~> 2.1', require: false
gem 'github_changelog_generator', '~> 1.16.4', require: false
end

group :coverage, optional: ENV['COVERAGE'] != 'yes' do
gem 'codecov', require: false
gem 'simplecov-console', require: false
end

group :development do
gem 'rake', '~> 13.0', '>= 13.0.6'
gem 'rspec', '~> 3.12'
gem 'rspec-collection_matchers', '~> 1.2'
gem 'rspec-its', '~> 1.3'
gem 'voxpupuli-rubocop', '~> 2.0'
end
226 changes: 0 additions & 226 deletions Gemfile.lock

This file was deleted.

Loading

0 comments on commit 5a82457

Please sign in to comment.