Skip to content

Commit

Permalink
CI: Separate jobs for test and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianbica authored Sep 4, 2019
1 parent d7bc8d6 commit c44539e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: RubyGem
on: [push]

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -13,18 +13,24 @@ jobs:
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Test
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake
- name: Rubocop
uses: gimenete/rubocop-action@1.0

publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Publish
if: success() && github.ref == 'master'
if: github.ref == 'master'
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
Expand Down

0 comments on commit c44539e

Please sign in to comment.