Skip to content

Add experimental support for SQLite #1135

Add experimental support for SQLite

Add experimental support for SQLite #1135

Workflow file for this run

name: RMT lint, unit + engines tests
on:
pull_request:
branches: [master]
env:
RAILS_ENV: test
jobs:
test:
runs-on: ubuntu-latest
strategy:
# Only use 2 workers, gh actions seems to kill jobs when we use more
max-parallel: 2
matrix:
# we need to test the Ruby versions of the products we release RMT for,
# those are: SLE15 (2.5.8, 2.5.9)
ruby-version: ['2.5.8', '2.5.9']
# skipping Ruby3 tests for now, because RMT isn't Ruby3 compatible yet, and the failing
# tests confuse the team.
# ruby-version: ['2.5.8', '2.5.9', '3.0.3']
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: rmt_test
MYSQL_USER: rmt
MYSQL_PASSWORD: rmt
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup database config file
run: |
sudo mkdir -p /var/lib/rmt
ruby -e "require 'yaml'; puts({'database_test'=>{'host' => '127.0.0.1', 'port' => 3306, 'username'=>'rmt','password'=>'rmt','database'=>'rmt_test','adapter'=>'mysql2','encoding'=>'utf8','timeout'=>5000,'pool'=>5}}.to_yaml)" > config/rmt.local.yml
- name: Run Lint
run: |
bundle exec rubocop -D
- name: Prepare database
run: |
bundle exec rails db:migrate
- name: Run core tests
run: |
bundle exec rspec --format documentation
- name: Run PubCloud engines tests
run: |
bundle exec rake test:engines
- name: Run version checks
run: |
echo "::group::Version verification checks"
ruby integration/ci_check.rb
echo "::endgroup::"