Skip to content

test

test #83

Workflow file for this run

name: test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- 3.2
#- 3.1
#- "3.0"
#- 2.7
#- 2.6
#- 2.5
rails-version:
# - "edge"
#- 7
- 6.1
#- "6.0"
exclude:
# Rails 7 requires Ruby 2.7+
- ruby-version: 2.5
rails-version: 7
- ruby-version: 2.6
rails-version: 7
# Rails 6 requires Ruby <= 3.0
- ruby-version: 3.1
rails-version: "6.0"
- ruby-version: 3.2
rails-version: "6.0"
steps:
- uses: actions/checkout@v3
- name: echo environment1
run: |
cat /etc/environment
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: echo environment2
run: |
cat /etc/environment
- uses: actions/setup-node@v3
with:
node-version: 18
- name: echo environment3
run: |
cat /etc/environment
- name: Add non-root user foo
run: |
whoami
adduser --disabled-login --disabled-password --gecos '' foo
- name: Install Yarn
run: |
su - foo <<'HERE'
npm install -g yarn
HERE
- name: Run gem tests
run: |
ruby --version
echo $PATH
su - foo <<'HERE'
echo $PATH
which ruby
echo GOT HERE 1
ruby --version
echo GOT HERE 2
gem install bundler
bundle config set --local path '/tmp/gem-tests'
bundle
bundle exec rake
HERE
- name: Set up new Rails dummy app
working-directory: ./spec
env:
RAILS_NEW_GEMFILE: dummy_app_config/gemfiles/Gemfile-rails-${{ matrix.rails-version }}
run: |
bundle config set --local path '/tmp/system-tests'
BUNDLE_GEMFILE=$RAILS_NEW_GEMFILE bundle
rails new dummy_app --database=sqlite3 --skip-active-storage --skip-action-cable --skip-spring --skip-listen --skip-test
cat dummy_app_config/Gemfile.append >> dummy_app/Gemfile
cd dummy_app
bundle
rails g rspec:install
cp -rf ../dummy_app_config/shared_source/all/* ./
cp -rf ../dummy_app_config/shared_source/${{ matrix.rails-version }}/* ./
yarn install
- name: Run Rails dummy app tests
working-directory: ./spec/dummy_app
run: |
rake db:drop db:create db:migrate
rake