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 env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Setup dependencies run: | for i in {1..60}; do docker-compose up -d && break; sleep 1; done # Wait until database servers start function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 ping --ssl-mode=DISABLED; } function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 ping --ssl-mode=DISABLED; } 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: MYSQL_PWD: password - name: Run tests run: ${{ matrix.env }} bundle exec rake env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} - name: Coveralls Parallel uses: coverallsapp/github-action@v1.1.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} flag-name: run-${{ matrix.ruby }}-${{ matrix.env }}-${{ matrix.gemfile }} parallel: true finish: needs: build runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: coverallsapp/github-action@v1.1.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true