Skip to content

Commit

Permalink
Update CI set-up
Browse files Browse the repository at this point in the history
We stopped using Travis CI some time ago, but never replaced it. Set
up GitHub actions for automated CI build and pushing new versions to
rubygems.
  • Loading branch information
KevinBrowne committed Feb 23, 2024
1 parent 273d196 commit e8b4314
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 27 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Gem

on:
release:
types:
- "created"

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build sinject.gemspec
gem push sinject-*.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on: [push]

jobs:
test:
strategy:
fail-fast: false
matrix:
# All the (nominally) supported Ruby versions
ruby: ['2.5', '2.6', '2.7', '3.0', '3.2', '3.3']

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rspec

- name: Upload Coverage Report to CodeClimate
# No sense uploading coverage for each Ruby version tested
if: ${{matrix.ruby == '3.3'}}
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion sinject.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler', '>= 1.11'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov_json_formatter'
end

0 comments on commit e8b4314

Please sign in to comment.