From c44539e904edc67595de16dc91787ce5a14f313a Mon Sep 17 00:00:00 2001 From: Cristian Bica Date: Thu, 5 Sep 2019 01:39:58 +0300 Subject: [PATCH] CI: Separate jobs for test and publish --- .github/workflows/gem.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gem.yml b/.github/workflows/gem.yml index 66b3ed9..fc3bd48 100644 --- a/.github/workflows/gem.yml +++ b/.github/workflows/gem.yml @@ -3,7 +3,7 @@ name: RubyGem on: [push] jobs: - build: + test: runs-on: ubuntu-latest steps: - name: Checkout @@ -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