Skip to content

Commit

Permalink
Refractor CI, Add Rails 7.1 to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Oct 17, 2023
1 parent 2a77cfe commit ab79606
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
61 changes: 26 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
name: Tests

on:
push:
branches:
- master
branches: ['master']
pull_request:
branches:
- '*'

jobs:
test_sqlite:
runs-on: ubuntu-20.04
test:
runs-on: ubuntu-latest

env:
RAILS_ENV: test

strategy:
fail-fast: false
matrix:
include:
### TEST ALL RUBY VERSIONS, USE DEFAULT GEMFILE
- ruby: 2.5
- ruby: 2.6
- ruby: 2.7
- ruby: "3.0" ### must be quoted otherwise will be treated as "3" which will resolve to latest 3.x version
- ruby: 3.1
- ruby: 3.2

### RAILS VERSION TESTING
- ruby: 2.6
env:
RAILS_VERSION: "5.0"
- ruby: 2.6
env:
RAILS_VERSION: "5.1"
- ruby: 2.6
### TEST RUBY VERSIONS
- ruby: "2.5"
- ruby: "2.6"
- ruby: "2.7"
- ruby: "3.0"
- ruby: "3.1"
- ruby: "3.2"
### TEST RAILS VERSIONS
- ruby: "2.6"
env:
RAILS_VERSION: "5.2"
- ruby: 2.6
- ruby: "2.6"
env:
RAILS_VERSION: "6.0"
- ruby: 2.6
- ruby: "2.6"
env:
RAILS_VERSION: "6.1"
- ruby: "3.1"
- ruby: "3.2"
env:
RAILS_VERSION: "7.0"

env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
DB_GEM: "sqlite3"
- ruby: "3.2"
env:
RAILS_VERSION: "7.1"

steps:
- uses: actions/checkout@v3
Expand All @@ -54,12 +46,11 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
bundler-cache: false ### not compatible with ENV-style Gemfile

- name: Run tests
env:
RAILS_ENV: test
- name: Run test
run: |
bundle install
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rspec
bundle exec rake test
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
log/*.log
pkg/
spec/dummy/db/*.sqlite3
spec/dummy/db/*.sqlite3-journal
spec/dummy/db/*.sqlite3-shm
spec/dummy/db/*.sqlite3-wal
spec/dummy/db/*.sqlite3*
spec/dummy/log/*.log
spec/dummy/storage/
spec/dummy/tmp/
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ load 'rails/tasks/statistics.rake'
require 'bundler/gem_tasks'

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task test: [:spec]
Expand Down

0 comments on commit ab79606

Please sign in to comment.