Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
- Test against latest stable Ruby versions
- Test against AR 7.1 and 7.2
- Do not test incompatible Ruby / AR versions (ex: Ruby 3.0 / AR 5.x)
- Use `include` syntax for legacy AR versions
- Mark `edge` tests as `experimental` to allow failures
- Update checkout actions
- Add explicit permissions for improved security

Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
  • Loading branch information
tagliala committed Sep 3, 2024
1 parent 06a42e3 commit bb64c82
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 15 deletions.
67 changes: 58 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Tests
on: [push, pull_request]

permissions:
contents: read

jobs:
test-27-plus:
runs-on: ubuntu-latest
Expand All @@ -9,21 +12,67 @@ jobs:
strategy:
matrix:
ruby:
- head
- "3.3"
- "3.2"
- "3.1"
- "3.0"
- "2.7"
gemfile:
- gemfiles/ar50.gemfile
- gemfiles/ar51.gemfile
- gemfiles/ar52.gemfile
- gemfiles/ar60.gemfile
- gemfiles/ar61.gemfile
- gemfiles/ar72.gemfile
- gemfiles/ar71.gemfile
- gemfiles/ar70.gemfile
- gemfiles/rgeo1.gemfile
- gemfiles/rgeo3.gemfile
- gemfiles/rgeo1.gemfile
channel: ['stable']
include:
# Test legacy AR 5.x/6.x series
- ruby: '2.7'
gemfile: gemfiles/ar50.gemfile
channel: 'stable'
- ruby: '2.7'
gemfile: gemfiles/ar51.gemfile
channel: 'stable'
- ruby: '2.7'
gemfile: gemfiles/ar52.gemfile
channel: 'stable'
- ruby: '2.7'
gemfile: gemfiles/ar60.gemfile
channel: 'stable'
- ruby: '2.7'
gemfile: gemfiles/ar61.gemfile
channel: 'stable'
- ruby: '3.0'
gemfile: gemfiles/ar60.gemfile
channel: 'stable'
- ruby: '3.0'
gemfile: gemfiles/ar61.gemfile
channel: 'stable'
- ruby: '3.1'
gemfile: gemfiles/ar61.gemfile
channel: 'stable'
# Test against Ruby head
- ruby: head
gemfile: gemfiles/ar71.gemfile
channel: 'experimental'
- ruby: head
gemfile: gemfiles/ar72.gemfile
channel: 'experimental'
- ruby: head
gemfile: gemfiles/rgeo3.gemfile
channel: 'experimental'
exclude:
- ruby: '2.7'
gemfile: gemfiles/ar72.gemfile
- ruby: '2.7'
gemfile: gemfiles/rgeo3.gemfile
- ruby: '3.0'
gemfile: gemfiles/ar72.gemfile
- ruby: '3.0'
gemfile: gemfiles/rgeo3.gemfile
continue-on-error: ${{ matrix.channel != 'stable' }}
steps:
- name: Set Up Gems
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set Up Deps
run: sudo apt-get install libgeos-dev
- name: Set Up Ruby
Expand Down Expand Up @@ -51,7 +100,7 @@ jobs:
- gemfiles/rgeo1.gemfile
steps:
- name: Set Up Gems
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set Up Deps
run: sudo apt-get install libgeos-dev
- name: Set Up Ruby
Expand Down
14 changes: 11 additions & 3 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ appraise "ar52" do
end

appraise "ar60" do
gem "activerecord", "~> 6.0.0.rc1"
gem "activerecord", "~> 6.0.0"
end

appraise "ar61" do
Expand All @@ -22,9 +22,17 @@ appraise "ar70" do
gem "activerecord", "~> 7.0.0"
end

appraise "ar71" do
gem "activerecord", "~> 7.1.0"
end

appraise "ar72" do
gem "activerecord", "~> 7.2.0"
end

appraise "rgeo3" do
gem "activerecord", "~> 7.0.0"
gem "rgeo", "~> 3.0.0"
gem "activerecord", "~> 7.2.0"
gem "rgeo", "~> 3.0"
end

appraise "rgeo1" do
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/ar60.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "activerecord", "~> 6.0.0.rc1"
gem "activerecord", "~> 6.0.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/ar71.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/ar72.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2.0"

gemspec path: "../"
4 changes: 2 additions & 2 deletions gemfiles/rgeo3.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 7.0.0"
gem "rgeo", "~> 3.0.0"
gem "activerecord", "~> 7.2.0"
gem "rgeo", "~> 3.0"

gemspec path: "../"

0 comments on commit bb64c82

Please sign in to comment.