Add appraisal to a rubygem project
Appraisals is a tool to generate different Gemfiles
so you can do matrix testing (e.g. different versions of ruby).
How to add appraisal
to your project
- Add the
appraisal
to the groupdevelopment
from the Gemfile
bundle add appraisal --skip-install --group development
- Run
bundle install
to install the dependencies.
bundle install
- Create a
Appraisals
file on root of the project.
# frozen_string_literal: true
SUPPORTED_VERSIONS = %w[3.8 3.9 4.0 4.1].freeze
SUPPORTED_VERSIONS.each do |version|
appraise "jekyll-#{version}" do
gem 'jekyll', version
end
end
- Generate the Gemfiles in the folder âgemfilesâ
bundle exec appraisal generate
- Create a
ci.yml
in the folder â.github/workflowsâ
name: CI
on:
push:
branches:
- "*"
tags-ignore:
- "*"
pull_request:
branches:
- "*"
tags-ignore:
- "*"
jobs:
build:
strategy:
matrix:
ruby: [2.4, 2.5, 2.6, 2.7]
gemfile:
- gemfiles/jekyll_3.8.gemfile
- gemfiles/jekyll_3.9.gemfile
- gemfiles/jekyll_4.0.gemfile
- gemfiles/jekyll_4.1.gemfile
exclude:
- ruby: 2.4
gemfile: gemfiles/jekyll_4.0.gemfile
- ruby: 2.4
gemfile: gemfiles/jekyll_4.1.gemfile
- ruby: 2.5
gemfile: gemfiles/jekyll_4.0.gemfile
- ruby: 2.5
gemfile: gemfiles/jekyll_4.1.gemfile
env:
BUNDLE_GEMFILE: $
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby $
uses: actions/setup-ruby@v1
with:
ruby-version: $
- name: bundle install
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run Test
run: bundle exec rake test
Weitere BeitrÀge innerhalb der Kategorie
Weitere BeitrÀge