Skip to content

Commit

Permalink
Redo Github action script to not need individual gemfiles (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Jun 3, 2023
1 parent 6a0227c commit 6af7867
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 139 deletions.
60 changes: 12 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: build

on: [push, pull_request]
Expand All @@ -15,49 +8,20 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- '3.0'
- 3.1
- 3.2
gemfile:
- Gemfile.rails50
- Gemfile.rails51
- Gemfile.rails52 # Min ruby 2.2.2
- Gemfile.rails60 # Min ruby 2.5.0
- Gemfile.rails61 # Min ruby 2.5.0
- Gemfile.rails70 # Min ruby 2.7.0
exclude:
- gemfile: Gemfile.rails50
ruby: 2.7
- gemfile: Gemfile.rails50
ruby: '3.0'
- gemfile: Gemfile.rails50
ruby: 3.1
- gemfile: Gemfile.rails50
ruby: 3.2
- gemfile: Gemfile.rails51
ruby: 2.7
- gemfile: Gemfile.rails51
ruby: '3.0'
- gemfile: Gemfile.rails51
ruby: 3.1
- gemfile: Gemfile.rails51
ruby: 3.2
- gemfile: Gemfile.rails52
ruby: 2.7
- gemfile: Gemfile.rails52
ruby: '3.0'
- gemfile: Gemfile.rails52
ruby: 3.1
- gemfile: Gemfile.rails52
ruby: 3.2
- gemfile: Gemfile.rails70
ruby: 2.6
rails: ["7.0", "6.1", "6.0"]
ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
include:
- rails: "5.2"
ruby: "2.7.8"
- rails: "5.1"
ruby: "2.6.10"
- rails: "5.0"
ruby: "2.6.10"

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
RUBY_VERSION: ${{ matrix.ruby }}
RAILS_VERSION: ${{ matrix.rails }}

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: gemfiles/Gemfile.rails70
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Changelog
===========

Also deleted the `Gemfile` that was now a broken symlink.
please use `export BUNDLE_GEMFILE='gemfiles/Gemfile.rails61'; bundle exec rspec` to run the test suite

## [v1.1.0](https://github.com/Apipie/apipie-rails/tree/v1.1.0) (2023-05-16)
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.0.0...v1.1.0)
Expand Down
20 changes: 20 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec path: '.'

# use ENV vars, with default value as fallback for local setup
ruby(ENV['RUBY_VERSION'] || '3.2.2')
gem 'actionpack', "~> #{ENV['RAILS_VERSION'] || '7.0'}.0"
gem 'activesupport', "~> #{ENV['RAILS_VERSION'] || '7.0'}.0"

gem 'mime-types' # , '~> 3.0'
gem 'rails-controller-testing'
gem 'rspec-rails' # , '~> 5.0'

# net-smtp not included by default in Ruby 3.1
# Will be fixed by https://github.com/mikel/mail/pull/1439
gem 'net-smtp', require: false if Gem.ruby_version >= Gem::Version.new('3.1.0')

gem 'test_engine', path: './spec/dummy/components/test_engine', group: :test
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1929,12 +1929,6 @@ And if you write one on your own, don't hesitate to share it with us!
Contributing
====================

Since this gem does not have a Gemfile, you need to specify it in your shell with:

.. code:: shell
BUNDLE_GEMFILE='gemfiles/Gemfile.rails61'
Then, you can install dependencies and run the test suite:

.. code:: shell
Expand Down
10 changes: 0 additions & 10 deletions gemfiles/Gemfile.rails50

This file was deleted.

10 changes: 0 additions & 10 deletions gemfiles/Gemfile.rails51

This file was deleted.

10 changes: 0 additions & 10 deletions gemfiles/Gemfile.rails52

This file was deleted.

17 changes: 0 additions & 17 deletions gemfiles/Gemfile.rails60

This file was deleted.

17 changes: 0 additions & 17 deletions gemfiles/Gemfile.rails61

This file was deleted.

17 changes: 0 additions & 17 deletions gemfiles/Gemfile.rails70

This file was deleted.

0 comments on commit 6af7867

Please sign in to comment.