name: test on: push: pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby: - 2.4 - 2.5 - 2.6 - 2.7 env: - MYSQL56=1 - MYSQL57=1 - POSTGRESQL=1 gemfile: - gemfiles/activerecord_5.1.gemfile - gemfiles/activerecord_5.2.gemfile - gemfiles/activerecord_6.0.gemfile - gemfiles/activerecord_6.1.gemfile exclude: - ruby: 2.4 gemfile: gemfiles/activerecord_6.0.gemfile - ruby: 2.4 gemfile: gemfiles/activerecord_6.1.gemfile steps: - uses: actions/checkout@v2 - uses: actions/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - uses: actions/cache@v2 with: path: gemfiles/vendor/bundle key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles('ridgepole.gemspec', '**/Gemfile', '${{ matrix.gemfile }}') }} restore-keys: | ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}- - name: Setup dependencies run: | for i in {1..60}; do docker-compose up -d && break; sleep 1; done gem install bundler bundle config path vendor/bundle bundle install --jobs 4 --retry 3 # Wait until database servers start function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 -ppassword ping; } function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 -ppassword ping; } function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; } for i in {1..60}; do mysql_ping && break; sleep 1; done for i in {1..60}; do mysql57_ping && break; sleep 1; done for i in {1..60}; do pg_ping && break; sleep 1; done env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} - run: ${{ matrix.env }} bundle exec rake env: BUNDLE_GEMFILE: ${{ matrix.gemfile }}