Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
# latest Postgres version:
- go-version: "1.26"
postgres-version: 18

fail-fast: false
timeout-minutes: 5

Expand Down Expand Up @@ -139,7 +140,30 @@
if: ${{ !matrix.primary }}
run: make test TEST_DATABASE=postgres

build_and_test_mysql:
env:
GOTOOLCHAIN: local
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v7

- name: Setup Go
uses: actions/setup-go@v7
with:
go-version: "1.27"

# MySQL is pre-installed on GitHub-hosted Ubuntu runners.
- name: Start MySQL
run: |
sudo systemctl start mysql
mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY ''; FLUSH PRIVILEGES;"

- name: Test with race detector
run: make test/race TEST_DATABASE=mysql

build_and_test_sqlite:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: build_and_test_sqlite (${{ matrix.go-version }}${{ matrix.primary && ', race' || '' }})
env:
GOTOOLCHAIN: local
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,27 @@ env:

jobs:
port_fixtures:
name: Port fixture tests
name: Port fixture tests (SQLite and MySQL)
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 25

env:
RIVER_RUST_MYSQL_URL: mysql://root@127.0.0.1:3306/
RIVER_TEST_DATABASE_URL: mysql://root@127.0.0.1:3306/
TEST_MYSQL_URL: mysql://root@127.0.0.1:3306/

services:
mysql:
image: mysql:8.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_ROOT_HOST: "%"
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root"
--health-interval 2s
--health-timeout 5s
--health-retries 30

steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -75,16 +93,32 @@ jobs:
- name: Rust fixture tests
run: make test/rust/conformance

- name: Rust MySQL fixture tests
run: make test/rust/conformance/mysql

- name: JavaScript fixture tests
run: make test/js/conformance

- name: JavaScript MySQL fixture tests
run: make test/js/conformance/mysql

- name: Java fixture tests
run: make test/java/conformance

- name: Java MySQL fixture tests
run: make test/java/conformance/mysql

- uses: ruby/setup-ruby@v1
with:
working-directory: ruby
bundler-cache: true

- name: Ruby fixture tests
env:
TEST_DATABASE: sqlite
run: make test/ruby/conformance

- name: Ruby MySQL fixture tests
env:
TEST_MYSQL_URL: mysql2://root@127.0.0.1:3306/
run: make test/ruby/conformance/mysql
34 changes: 34 additions & 0 deletions .github/workflows/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "Makefile"
- "conformance/**"
- "java/**"
- "riverdriver/rivermysql/migration/**"
- "riverdriver/riverpgxv5/migration/**"
- "riverdriver/riversqlite/migration/**"
pull_request:
Expand All @@ -20,6 +21,7 @@ on:
- "Makefile"
- "conformance/**"
- "java/**"
- "riverdriver/rivermysql/migration/**"
- "riverdriver/riverpgxv5/migration/**"
- "riverdriver/riversqlite/migration/**"
workflow_dispatch:
Expand Down Expand Up @@ -130,3 +132,35 @@ jobs:

- name: Postgres client, worker, and migration tests
run: make test/java/postgres

mysql:
name: Test (MySQL ${{ matrix.mysql-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
mysql-version: ["8.0", "8.4"]
env:
RIVER_TEST_DATABASE_URL: mysql://root@127.0.0.1:3306/
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_ROOT_HOST: "%"
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root"
--health-interval 2s
--health-timeout 5s
--health-retries 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ./.github/actions/setup-java
- uses: actions/setup-go@v6
with:
go-version-file: go.work
- run: make test/java/mysql
33 changes: 33 additions & 0 deletions .github/workflows/js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,36 @@ jobs:
- run: node cli/dist/bin.js migrate-up --database-url "$TEST_DATABASE_URL"

- run: pnpm run test:integration

mysql:
name: Test (MySQL ${{ matrix.mysql-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
mysql-version: ["8.0", "8.4"]
env:
TEST_MYSQL_URL: mysql://root@127.0.0.1:3306/
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_ROOT_HOST: "%"
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root"
--health-interval 2s
--health-timeout 5s
--health-retries 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ./.github/actions/setup-js
- uses: actions/setup-go@v7
with:
go-version-file: go.work
- run: make test/js/mysql
working-directory: .
50 changes: 48 additions & 2 deletions .github/workflows/ruby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ defaults:

jobs:
checks:
# Check coverage from the two backends without adding another CI job.
needs: [test, test_sqlite]
# Check coverage from all backends without adding another CI job.
needs: [test, test_sqlite, mysql]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -207,3 +207,49 @@ jobs:
env:
RAILS_VERSION: "~> 8.1.0"
run: bundle install && bundle exec rspec

mysql:
name: Test (MySQL ${{ matrix.mysql-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
mysql-version: ["8.0", "8.4"]
env:
RIVER_REQUIRE_DATABASES: "1"
TEST_DATABASE: mysql
TEST_MYSQL_URL: mysql2://root@127.0.0.1:3306/
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_ROOT_HOST: "%"
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root"
--health-interval 2s
--health-timeout 5s
--health-retries 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
working-directory: ruby
bundler-cache: true
- uses: actions/setup-go@v7
with:
go-version-file: go.work
- run: make generate/fixtures spec/core
- uses: actions/upload-artifact@v7
if: matrix.mysql-version == '8.4'
with:
name: ruby-coverage-mysql
path: ruby/coverage/.resultset.json
include-hidden-files: true
if-no-files-found: error
retention-days: 1
35 changes: 34 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "Makefile"
- "conformance/**"
- "internal/cmd/syncrustmigrations/**"
- "riverdriver/rivermysql/migration/**"
- "riverdriver/riverpgxv5/migration/**"
- "riverdriver/riversqlite/migration/**"
- "rust/**"
Expand All @@ -20,6 +21,7 @@ on:
- "Makefile"
- "conformance/**"
- "internal/cmd/syncrustmigrations/**"
- "riverdriver/rivermysql/migration/**"
- "riverdriver/riverpgxv5/migration/**"
- "riverdriver/riversqlite/migration/**"
- "rust/**"
Expand Down Expand Up @@ -53,7 +55,7 @@ jobs:
with:
tool: cargo-deny@0.20.2

- name: Lint, including Postgres-only and SQLite-only builds
- name: Lint, including each backend on its own
run: make lint/rust

- name: Documentation and examples
Expand Down Expand Up @@ -191,3 +193,34 @@ jobs:
run: PGPASSWORD=postgres createdb -h localhost -U postgres river_rust_test
- name: Rust unit, SQLite, and Postgres tests
run: make test/rust

mysql:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
mysql-version: ["8.0", "8.4"]
env:
RIVER_RUST_MYSQL_URL: mysql://root:root@127.0.0.1:3306/
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: "%"
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -proot"
--health-interval 5s
--health-timeout 5s
--health-retries 20
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/setup-go@v7
with:
go-version-file: go.work
- run: make test/rust/mysql
Loading
Loading