Skip to content

Commit

Permalink
Merge pull request #35 from FundingCircle/update-bundler-and-ci
Browse files Browse the repository at this point in the history
Update the gem to work with ruby 3.3 and switch to github actions
  • Loading branch information
bliof-fc committed Mar 28, 2024
2 parents 80b7e16 + 20c6560 commit ed929b1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 94 deletions.
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

0 comments on commit ed929b1

Please sign in to comment.