name: test on: push: pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby: - 2.7 - 3.0 - 3.1 env: - ARMG_TEST_MYSQL_PORT=10056 ARMG_TEST_MYSQL_ENGINE=MyISAM - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=MyISAM - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=InnoDB - ARMG_TEST_MYSQL_PORT=10080 ARMG_TEST_MYSQL_ENGINE=MyISAM - ARMG_TEST_MYSQL_PORT=10080 ARMG_TEST_MYSQL_ENGINE=InnoDB gemfile: - gemfiles/ar60.gemfile - gemfiles/ar61.gemfile - gemfiles/ar70.gemfile steps: - uses: actions/checkout@v2 - uses: ruby/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 $1 ping; } for i in {1..60}; do mysql_ping 10056 && break; sleep 1; done for i in {1..60}; do mysql_ping 10057 && break; sleep 1; done for i in {1..60}; do mysql_ping 10080 && break; sleep 1; done env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} - run: ${{ matrix.env }} bundle exec rake env: BUNDLE_GEMFILE: ${{ matrix.gemfile }}