-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add separate GitHub Actions for PostgreSQL and MySQL CI (#93)
* chore: Add separate GitHub Actions for PostgreSQL and MySQL CI Separated PostgreSQL and MySQL configurations into distinct GitHub Actions for clarity and easier maintenance. Updated .github/workflows/ci.yml to remove redundancies while creating ci-postgresql.yml and ci-mysql.yml with respective configurations. This enhances our CI/CD pipeline by organizing workflows better and ensuring clear separation between SQL variants.
- Loading branch information
Showing
3 changed files
with
121 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters