feat(pls): add get_generators
utility to retrieve generator blocks even when datasource is invalid
#4985
This file contains hidden or 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
name: 'SE' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- '.github/**' | |
- '!.github/workflows/test-schema-engine.yml' | |
- '!.github/workflows/test-schema-engine-linux-template.yml' | |
- '*.md' | |
- 'LICENSE' | |
- 'CODEOWNERS' | |
# Specific | |
- 'query-engine/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-mongodb-schema-connector: | |
if: github.event_name == 'push' || | |
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/test-all')) | |
strategy: | |
fail-fast: false | |
matrix: | |
database: | |
- name: 'mongodb5' | |
url: 'mongodb://prisma:prisma@localhost:27018/?authSource=admin&retryWrites=true' | |
- name: 'mongodb44' | |
url: 'mongodb://prisma:prisma@localhost:27017/?authSource=admin&retryWrites=true' | |
- name: 'mongodb42' | |
url: 'mongodb://prisma:prisma@localhost:27016/?authSource=admin&retryWrites=true' | |
name: '${{ matrix.database.name }}' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: taiki-e/install-action@nextest | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
continue-on-error: true | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Cache Docker images. | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ matrix.database.name }}-${{hashFiles('docker-compose.yaml')}} | |
- name: 'Start ${{ matrix.database.name }}' | |
run: make start-${{ matrix.database.name }}-single | |
# MongoDB tests MUST run single threaded | |
- run: cargo nextest run -p mongodb-schema-connector --test-threads=1 | |
env: | |
CLICOLOR_FORCE: 1 | |
TEST_DATABASE_URL: ${{ matrix.database.url }} | |
test-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
ubuntu: | |
- '24.04' | |
database: | |
- name: mssql_2022 | |
url: 'sqlserver://localhost:1435;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED' | |
- name: mysql_8 | |
url: 'mysql://root:prisma@localhost:3307' | |
- name: postgres16 | |
url: 'postgresql://postgres:prisma@localhost:5439' | |
- name: sqlite | |
url: sqlite | |
name: '${{ matrix.database.name }} on Linux' | |
uses: ./.github/workflows/test-schema-engine-linux-template.yml | |
with: | |
ubuntu: ${{ matrix.ubuntu }} | |
database_name: ${{ matrix.database.name }} | |
database_url: ${{ matrix.database.url }} | |
test-linux-push: | |
if: | | |
github.event_name == 'push' || | |
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/test-all')) | |
strategy: | |
fail-fast: false | |
matrix: | |
ubuntu: | |
- '24.04' | |
database: | |
- name: mssql_2019 | |
url: 'sqlserver://localhost:1433;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED' | |
- name: mysql_5_6 | |
url: 'mysql://root:prisma@localhost:3309' | |
- name: mysql_5_7 | |
url: 'mysql://root:prisma@localhost:3306' | |
- name: mysql_mariadb | |
url: 'mysql://root:prisma@localhost:3308' | |
- name: postgres12 | |
url: 'postgresql://postgres:prisma@localhost:5434' | |
- name: postgres13 | |
url: 'postgresql://postgres:prisma@localhost:5435' | |
- name: postgres14 | |
url: 'postgresql://postgres:prisma@localhost:5437' | |
- name: postgres15 | |
url: 'postgresql://postgres:prisma@localhost:5438' | |
- name: cockroach_23_1 | |
url: 'postgresql://prisma@localhost:26260' | |
- name: cockroach_22_2 | |
url: 'postgresql://prisma@localhost:26259' | |
- name: cockroach_22_1_0 | |
url: 'postgresql://prisma@localhost:26257' | |
- name: vitess_8_0 | |
url: 'mysql://root:prisma@localhost:33807/test' | |
shadow_database_url: 'mysql://root:prisma@localhost:33808/shadow' | |
is_vitess: true | |
single_threaded: true | |
name: '${{ matrix.database.name }} on Linux' | |
uses: ./.github/workflows/test-schema-engine-linux-template.yml | |
with: | |
ubuntu: ${{ matrix.ubuntu }} | |
database_name: ${{ matrix.database.name }} | |
database_url: ${{ matrix.database.url }} | |
shadow_database_url: ${{ matrix.database.shadow_database_url }} | |
is_vitess: ${{ matrix.database.is_vitess || false }} | |
single_threaded: ${{ matrix.database.single_threaded || false }} | |
test-windows: | |
if: github.event_name == 'push' || | |
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/test-all')) | |
strategy: | |
fail-fast: false | |
matrix: | |
database: | |
- name: 'mysql-lts' | |
url: 'mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60' | |
- name: 'mariadb' | |
url: 'mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60' | |
rust: | |
- stable | |
os: | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
name: '${{ matrix.database.name }} on Windows' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: taiki-e/install-action@nextest | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install ${{ matrix.database.name }} | |
run: | | |
iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1' | |
.\install.ps1 -RunAsAdmin | |
scoop install sudo | |
scoop install ${{ matrix.database.name }} | |
sudo mysqld --install | |
sudo sc start MySQL | |
- name: Run tests | |
run: cargo nextest run -p sql-migration-tests --test-threads=8 | |
env: | |
TEST_DATABASE_URL: ${{ matrix.database.url }} |