Skip to content

enhance tasks

enhance tasks #32

Workflow file for this run

name: Test and Release
on:
pull_request:
push:
paths:
- .github/**
- lib/**
- spec/**
- Gemfile
- Rakefile
- compose.yml
- replica_pools.gemspec
release:
types:
- published
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "2.7"
- "3.1"
- "3.2"
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- run: docker compose up --detach
- run: bundle install --jobs 4 --retry 3
- run: bundle exec rake bootstrap
- run: bundle exec rake spec
push:
name: Publish Gem
if: ${{ github.event.release }}
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
# The kickstarter/actions/setup-rubygems action is not available
# because this is a public repo
- name: setup-rubygems
run: |
mkdir -p ~/.gem
cat <<-YAML > ~/.gem/credentials
---
:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
YAML
chmod 0600 ~/.gem/credentials
- run: bundle install
- run: bundle exec rake release