Skip to content

Release v1.0.0: modernize CI matrix and raise Ruby floor to 3.1 #83

Release v1.0.0: modernize CI matrix and raise Ruby floor to 3.1

Release v1.0.0: modernize CI matrix and raise Ruby floor to 3.1 #83

Workflow file for this run

---
name: CI
on:
push:
tags: ['v*']
branches: [master]
pull_request:
branches: ['**']
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2', '3.3', '3.4', jruby-head, truffleruby-head]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: start MySQL
run: sudo /etc/init.d/mysql start
- run: bundle exec rspec --format doc
env:
MYSQL_USER: root
MYSQL_PASSWORD: root
- uses: codecov/codecov-action@v4
if: matrix.ruby == '3.4'
with:
files: coverage/coverage.xml
- run: bin/check-version
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bundle exec rubocop
yard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bin/yardoc --fail-on-warning
check_version:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bin/check-version
release:
needs: [test, rubocop, yard, check_version]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"