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

Update the gem to work with ruby 3.3 and switch to github actions #35

Merged
merged 1 commit into from
Mar 28, 2024
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
86 changes: 0 additions & 86 deletions .circleci/config.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build & Test
run-name: Build & Test - ${{ github.ref_name }}

on:
push:
branches: [ master ]
pull_request:

jobs:
version-check:
runs-on: ubuntu-latest
if: "!contains(github.ref, 'master')"
steps:
- name: Checkout commit
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Gem versioned correctly
shell: sh
run: |
CHANGED=$(git diff origin/master HEAD --name-only | grep 'lib/hellgrid') || exit 0
[[ -z "$CHANGED" ]] || (echo "$CHANGED" | grep 'version.rb') || exit 1

build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true

- name: Run tests
run: bundle exec rspec
28 changes: 28 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to RubyGems
run-name: ${{ github.actor }} is publishing a new version

on:
release:
types: [published]

jobs:
publish-gem:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: Build gem
run: gem build hellgrid.gemspec

- name: Publish gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
gem push hellgrid-*.gem
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Utility which will output a table containing gem versions used across your projects.

[![Build Status`](https://circleci.com/gh/FundingCircle/hellgrid.svg?style=svg)](https://circleci.com/gh/FundingCircle/hellgrid)
[![Maintainability](https://api.codeclimate.com/v1/badges/13deecf7ca1f69197cbe/maintainability)](https://codeclimate.com/github/FundingCircle/hellgrid/maintainability)
[![Build & Test](https://github.com/FundingCircle/hellgrid/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/FundingCircle/hellgrid/actions/workflows/build-and-test.yml)

## Install

Expand Down
1 change: 0 additions & 1 deletion hellgrid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'bundler', '>= 1.11.0', '< 3'

s.add_development_dependency 'rspec', '~> 3.8.0'
s.add_development_dependency 'simplecov', '~> 0.16.0'
end
2 changes: 1 addition & 1 deletion lib/hellgrid/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def start
matrix = Hellgrid::Matrix.new

Find.find(folder) do |path|
if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock'))
if File.directory?(path) && File.exist?(File.join(path, 'Gemfile.lock'))
matrix.add_project(Hellgrid::Project.new(folder, path))
Find.prune unless recursive_search
end
Expand Down
2 changes: 1 addition & 1 deletion lib/hellgrid/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Hellgrid
VERSION = '0.3.5'
VERSION = '0.4.0'
end
3 changes: 0 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'simplecov'
SimpleCov.start

require 'fileutils'
require 'hellgrid'
require 'hellgrid/project'
Expand Down