Skip to content

Commit

Permalink
Merge pull request #141 from datacite/workflows
Browse files Browse the repository at this point in the history
Test against multiple versions of ruby (2.6, 2.7, 3.0, and 3.1)
  • Loading branch information
jrhoads authored Oct 13, 2022
2 parents a26a7bc + c508a96 commit b7947f6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 49 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,19 @@ on:
branches:
- "master"
jobs:
ci:
uses: ./.github/workflows/ci.yml
build:
needs: ci
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Build and test
run: |
gem install bundler
bundle install
bundle exec rspec
- name: Publish code coverage
uses: paambaati/codeclimate-action@v2.7.4
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

- name: Notify Slack
uses: adamkdean/simple-slack-notify@1.0.4
with:
channel: '#ops'
username: 'GitHub Actions'
color: 'good'
text: 'A new version of the bolognese gem has been built.'
text: 'A new version of the bolognese gem is ready for release.'

22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Tests
on:
workflow_call:

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{matrix.ruby}}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true

- name: Run tests
run: |
bundle exec rspec
16 changes: 2 additions & 14 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,5 @@ on:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Install and test
run: |
gem install bundler
bundle install
bundle exec rspec
ci:
uses: ./.github/workflows/ci.yml
19 changes: 7 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,23 @@ on:
release:
types: [published]
jobs:
ci:
uses: ./.github/workflows/ci.yml
build:
needs: ci
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Build and test
- name: Build
run: |
gem install bundler
bundle install
bundle exec rspec spec
- name: Code Climate Test Reporter
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build
- name: Publish to RubyGems
run: |
Expand All @@ -44,4 +39,4 @@ jobs:
channel: '#ops'
username: 'GitHub Actions'
color: 'good'
text: 'A new version of the bolognese gem has been released.'
text: 'A new version of the bolognese gem has been released.'
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bolognese (1.9.17)
bolognese (1.9.18)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down Expand Up @@ -95,7 +95,7 @@ GEM
multi_json (~> 1.15)
rack (~> 2.2)
rdf (~> 3.2, >= 3.2.9)
json-ld-preloaded (3.2.0)
json-ld-preloaded (3.2.1)
json-ld (~> 3.2)
rdf (~> 3.2)
jsonlint (0.3.0)
Expand Down Expand Up @@ -158,7 +158,7 @@ GEM
rdf-turtle (3.2.1)
ebnf (~> 2.3)
rdf (~> 3.2)
rdf-vocab (3.2.1)
rdf-vocab (3.2.2)
rdf (~> 3.2, >= 3.2.4)
rdf-xsd (3.2.1)
rdf (~> 3.2)
Expand Down Expand Up @@ -201,7 +201,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.0)
zeitwerk (2.6.1)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion bolognese.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.version = Bolognese::VERSION
s.extra_rdoc_files = ["README.md"]
s.license = 'MIT'
s.required_ruby_version = '~> 2.3'
s.required_ruby_version = ['>=2.3']

# Declare dependencies here, rather than in the Gemfile
s.add_dependency 'maremma', '>= 4.9.4', '< 5'
Expand Down

0 comments on commit b7947f6

Please sign in to comment.