Skip to content

Commit

Permalink
Run integration tests on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Dec 8, 2021
1 parent 9ff69a1 commit a4d5bed
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Integration tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: Integration tests
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: ['2.5', '2.6', '2.7', '3.0']
fixture: [ '{rails6}', '{rails7}' ]
experimental: [false]

include:
- ruby-version: 'head'
fixture: '{rails6}'
experimental: true
- ruby-version: 'head'
fixture: '{rails7}'
experimental: true

exclude:
- ruby-version: '2.5'
fixture: '{rails7}'
- ruby-version: '2.6'
fixture: '{rails7}'

env:
FIXTURE: ${{ matrix.fixture }}

continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test:clean test:setup test:fixtures
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
# rake test:setup
# rake test:full

fixture_list = "{padrino_test,sinatra_test,rails2,rails3,rails3_2,rails4,rails5,rails5_api,rails6,rails7}"
fixture_list = ENV['FIXTURE'] || "{padrino_test,sinatra_test,rails2,rails3,rails3_2,rails4,rails5,rails5_api,rails6,rails7}"

desc "Clean up the fixtures being tested by cleaning and installing dependencies"
task "test:clean" do
Expand Down Expand Up @@ -52,7 +52,7 @@ task "test:fixtures" do
Dir[File.dirname(__FILE__) + "/fixtures/#{fixture_list}"].each do |fixture|
puts "\n*** Running tests for #{File.basename(fixture)}... ***\n"
Bundler.with_clean_env {
Dir.chdir(fixture) { puts `bundle check; bundle exec rake test:rabl` }
Dir.chdir(fixture) { sh 'bundle check; bundle exec rake test:rabl' }
}
end
end
Expand Down

0 comments on commit a4d5bed

Please sign in to comment.