diff --git a/.github/workflows/ci-mysql.yml b/.github/workflows/ci-mysql.yml new file mode 100644 index 0000000..226c2b7 --- /dev/null +++ b/.github/workflows/ci-mysql.yml @@ -0,0 +1,57 @@ +name: CI Mysql +on: + pull_request: + branches: + - master +jobs: + minitest: + runs-on: ubuntu-latest + name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} + services: + mysql: + image: mysql/mysql-server:5.7 + ports: + - "3306:3306" + env: + MYSQL_USER: with_advisory + MYSQL_PASSWORD: with_advisory_pass + MYSQL_DATABASE: with_advisory_lock_test + MYSQL_ROOT_HOST: '%' + strategy: + fail-fast: false + matrix: + ruby: + - '3.2' + - '3.1' + - '3.0' + - '2.7' + - '3.3' + - 'truffleruby' + rails: + - 7.1 + - "7.0" + - 6.1 + adapter: + - mysql2://with_advisory:with_advisory_pass@0/with_advisory_lock_test + - trilogy://with_advisory:with_advisory_pass@0/with_advisory_lock_test + include: + - ruby: jruby + rails: 6.1 + adapter: jdbcmysql://with_advisory:with_advisory_pass@0/with_advisory_lock_test + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + rubygems: latest + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile + - name: Test + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile + DATABASE_URL: ${{ matrix.adapter }} + WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }} + run: bundle exec rake diff --git a/.github/workflows/ci-postgresql.yml b/.github/workflows/ci-postgresql.yml new file mode 100644 index 0000000..6752861 --- /dev/null +++ b/.github/workflows/ci-postgresql.yml @@ -0,0 +1,58 @@ +name: CI Postgresql +on: + pull_request: + branches: + - master +jobs: + minitest: + runs-on: ubuntu-latest + services: + postgres: + image: 'postgres:14-alpine' + ports: ['5432:5432'] + env: + POSTGRES_USER: with_advisory + POSTGRES_PASSWORD: with_advisory_pass + POSTGRES_DB: with_advisory_lock_test + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + ruby: + - '3.2' + - '3.1' + - '3.0' + - '2.7' + - '3.3' + - 'truffleruby' + rails: + - 7.1 + - "7.0" + - 6.1 + adapter: + - postgres://with_advisory:with_advisory_pass@0/with_advisory_lock_test + include: + - ruby: jruby + rails: 6.1 + adapter: jdbcpostgresql://with_advisory:with_advisory_pass@0/with_advisory_lock_test + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + rubygems: latest + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile + - name: Test + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile + DATABASE_URL: ${{ matrix.adapter }} + WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }} + run: bundle exec rake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efdd5e8..faf18c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,28 +9,6 @@ on: jobs: minitest: runs-on: ubuntu-latest - services: - mysql: - image: mysql/mysql-server:5.7 - ports: - - "3306:3306" - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: with_advisory_lock_test - MYSQL_ROOT_HOST: '%' - postgres: - image: 'postgres:14-alpine' - ports: ['5432:5432'] - env: - POSTGRES_USER: closure_tree - POSTGRES_PASSWORD: closure_tree - POSTGRES_DB: with_advisory_lock_test - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - strategy: fail-fast: false matrix: @@ -42,24 +20,15 @@ jobs: - '3.3' - 'truffleruby' rails: - - activerecord_7.1 - - activerecord_7.0 - - activerecord_6.1 + - 7.1 + - "7.0" + - 6.1 adapter: - sqlite3:///tmp/test.sqlite3 - - mysql2://root:root@0/with_advisory_lock_test - - trilogy://root:root@0/with_advisory_lock_test - - postgres://closure_tree:closure_tree@0/with_advisory_lock_test include: - ruby: jruby - rails: activerecord_6.1 - adapter: jdbcmysql://root:root@0/with_advisory_lock_test - - ruby: jruby - rails: activerecord_6.1 + rails: 6.1 adapter: jdbcsqlite3:///tmp/test.sqlite3 - - ruby: jruby - rails: activerecord_6.1 - adapter: jdbcpostgresql://closure_tree:closure_tree@0/with_advisory_lock_test steps: - name: Checkout uses: actions/checkout@v4 @@ -71,11 +40,11 @@ jobs: bundler-cache: true rubygems: latest env: - BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile - name: Test env: - BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.rails }}.gemfile DATABASE_URL: ${{ matrix.adapter }} WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }} run: bundle exec rake