From d572b01dea17e160503a0c91bbd0e652133e8d3b Mon Sep 17 00:00:00 2001 From: Miguel Fernandez Date: Mon, 22 Jan 2024 16:16:27 +0100 Subject: [PATCH] Temp: remove wf files --- .../workflows/build-engines-apple-intel.yml | 50 ---- .../workflows/build-engines-apple-silicon.yml | 52 ---- .github/workflows/build-engines-windows.yml | 45 ---- .../workflows/build-prisma-schema-wasm.yml | 24 -- .github/workflows/codspeed.yml | 40 --- .github/workflows/formatting.yml | 51 ---- .github/workflows/on-push-to-main.yml | 29 -- .../workflows/publish-prisma-schema-wasm.yml | 66 ----- .../workflows/publish-query-engine-wasm.yml | 63 ----- .github/workflows/send-main-push-event.yml | 20 -- .github/workflows/test-compilation.yml | 40 --- .github/workflows/test-quaint.yml | 51 ---- .../workflows/test-query-engine-black-box.yml | 72 ----- .../test-query-engine-driver-adapters.yml | 106 -------- .github/workflows/test-query-engine.yml | 107 -------- .github/workflows/test-schema-engine.yml | 249 ------------------ .github/workflows/test-unit-tests.yml | 43 --- .github/workflows/wasm-size.yml | 108 -------- 18 files changed, 1216 deletions(-) delete mode 100644 .github/workflows/build-engines-apple-intel.yml delete mode 100644 .github/workflows/build-engines-apple-silicon.yml delete mode 100644 .github/workflows/build-engines-windows.yml delete mode 100644 .github/workflows/build-prisma-schema-wasm.yml delete mode 100644 .github/workflows/codspeed.yml delete mode 100644 .github/workflows/formatting.yml delete mode 100644 .github/workflows/on-push-to-main.yml delete mode 100644 .github/workflows/publish-prisma-schema-wasm.yml delete mode 100644 .github/workflows/publish-query-engine-wasm.yml delete mode 100644 .github/workflows/send-main-push-event.yml delete mode 100644 .github/workflows/test-compilation.yml delete mode 100644 .github/workflows/test-quaint.yml delete mode 100644 .github/workflows/test-query-engine-black-box.yml delete mode 100644 .github/workflows/test-query-engine-driver-adapters.yml delete mode 100644 .github/workflows/test-query-engine.yml delete mode 100644 .github/workflows/test-schema-engine.yml delete mode 100644 .github/workflows/test-unit-tests.yml delete mode 100644 .github/workflows/wasm-size.yml diff --git a/.github/workflows/build-engines-apple-intel.yml b/.github/workflows/build-engines-apple-intel.yml deleted file mode 100644 index a7e93220981f..000000000000 --- a/.github/workflows/build-engines-apple-intel.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build Engines for Apple Intel -on: - workflow_dispatch: - inputs: - commit: - description: "Commit on the given branch to build" - required: false - -jobs: - build: - # Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit - name: "MacOS Intel engines build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}" - env: - SQLITE_MAX_VARIABLE_NUMBER: 250000 - SQLITE_MAX_EXPR_DEPTH: 10000 - - # minimum supported version of macOS - MACOSX_DEPLOYMENT_TARGET: 10.15 - runs-on: macos-13 - - steps: - - name: Output link to real commit - run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }} - - - name: Checkout ${{ github.event.inputs.commit }} - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.commit }} - - - uses: dtolnay/rust-toolchain@stable - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-intel-cargo-${{ hashFiles('**/Cargo.lock') }} - - - run: | - cargo build --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt - - - uses: actions/upload-artifact@v4 - with: - name: binaries - path: | - ${{ github.workspace }}/target/release/schema-engine - ${{ github.workspace }}/target/release/prisma-fmt - ${{ github.workspace }}/target/release/query-engine - ${{ github.workspace }}/target/release/libquery_engine.dylib diff --git a/.github/workflows/build-engines-apple-silicon.yml b/.github/workflows/build-engines-apple-silicon.yml deleted file mode 100644 index 82ec65bea66a..000000000000 --- a/.github/workflows/build-engines-apple-silicon.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build Engines for Apple Silicon -on: - workflow_dispatch: - inputs: - commit: - description: "Commit on the given branch to build" - required: false - -jobs: - build: - # Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit - name: "MacOS ARM64 (Apple Silicon) engines build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}" - env: - SQLITE_MAX_VARIABLE_NUMBER: 250000 - SQLITE_MAX_EXPR_DEPTH: 10000 - runs-on: macos-13 - - steps: - - name: Output link to real commit - run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }} - - - name: Checkout ${{ github.event.inputs.commit }} - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.commit }} - - - uses: dtolnay/rust-toolchain@stable - - - name: Install aarch64 toolchain - run: rustup target add aarch64-apple-darwin - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - run: xcodebuild -showsdks - - - run: | - cargo build --target=aarch64-apple-darwin --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt - - - uses: actions/upload-artifact@v4 - with: - name: binaries - path: | - ${{ github.workspace }}/target/aarch64-apple-darwin/release/schema-engine - ${{ github.workspace }}/target/aarch64-apple-darwin/release/prisma-fmt - ${{ github.workspace }}/target/aarch64-apple-darwin/release/query-engine - ${{ github.workspace }}/target/aarch64-apple-darwin/release/libquery_engine.dylib diff --git a/.github/workflows/build-engines-windows.yml b/.github/workflows/build-engines-windows.yml deleted file mode 100644 index 7916cb53ff8e..000000000000 --- a/.github/workflows/build-engines-windows.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build Engines for Windows -on: - workflow_dispatch: - inputs: - commit: - description: "Commit on the given branch to build" - required: true - -jobs: - build: - # Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit - name: "Windows engines build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}" - env: - SQLITE_MAX_VARIABLE_NUMBER: 250000 - SQLITE_MAX_EXPR_DEPTH: 10000 - RUSTFLAGS: "-C target-feature=+crt-static" - runs-on: windows-latest - - steps: - - name: Output link to real commit - run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }} - - - name: Checkout ${{ github.event.inputs.commit }} - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.commit }} - - - uses: dtolnay/rust-toolchain@stable - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - run: cargo build --release - - - uses: actions/upload-artifact@v4 - with: - name: binaries - path: | - ${{ github.workspace }}/target/release/*.exe - ${{ github.workspace }}/target/release/*.dll diff --git a/.github/workflows/build-prisma-schema-wasm.yml b/.github/workflows/build-prisma-schema-wasm.yml deleted file mode 100644 index f52db55654e7..000000000000 --- a/.github/workflows/build-prisma-schema-wasm.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Prisma Schema (WASM) -on: - push: - branches: - - main - pull_request: - paths-ignore: - - "!.github/workflows/build-prisma-schema-wasm.yml" - - ".github/**" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v24 - - - run: nix build .#prisma-schema-wasm - - run: nix flake check diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml deleted file mode 100644 index 6a0f8bb124ac..000000000000 --- a/.github/workflows/codspeed.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "QE: Codespeed benchmarks" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - ".github/**" - - "!.github/workflows/benchmark.yml" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - name: Install cargo-codspeed - run: cargo install cargo-codspeed - - - name: "Build the benchmark targets: schema" - run: cargo codspeed build -p schema - - - name: "Build the benchmark targets: request-handlers" - run: cargo codspeed build -p request-handlers - - - name: Run the benchmarks - uses: CodSpeedHQ/action@v2 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml deleted file mode 100644 index af9dcaf44b01..000000000000 --- a/.github/workflows/formatting.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "All crates: linting" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - ".github/**" - - "!.github/workflows/formatting.yml" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - clippy: - name: clippy linting - runs-on: ubuntu-latest - env: - RUSTFLAGS: "-Dwarnings" - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - targets: wasm32-unknown-unknown - - run: | - cargo clippy --all-features - cargo clippy --all-features -p query-engine-wasm --target wasm32-unknown-unknown - - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Check formatting - run: cargo fmt -- --check - - shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml deleted file mode 100644 index 093fcabc1736..000000000000 --- a/.github/workflows/on-push-to-main.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Generate cargo docs & engines size -on: - workflow_dispatch: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - publish-to-gh-pages: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v24 - - run: | - git config user.email "prismabots@gmail.com" - git config user.name "prisma-bot" - - - name: Generate cargo docs for the workspace to gh-pages branch - run: nix run .#publish-cargo-docs - - - name: Publish engines size to gh-pages branch - run: nix run .#publish-engine-size diff --git a/.github/workflows/publish-prisma-schema-wasm.yml b/.github/workflows/publish-prisma-schema-wasm.yml deleted file mode 100644 index c8923944cb4a..000000000000 --- a/.github/workflows/publish-prisma-schema-wasm.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Build and publish @prisma/prisma-schema-wasm -run-name: npm - release @prisma/prisma-schema-wasm@${{ github.event.inputs.enginesWrapperVersion }} from ${{ github.event.inputs.enginesHash }} on ${{ github.event.inputs.npmDistTag }} - -concurrency: publish-prisma-schema-wasm - -on: - # usually triggered via GH Actions Workflow in prisma/engines-wrapper repo - workflow_dispatch: - inputs: - enginesWrapperVersion: - required: true - description: 'New @prisma/prisma-schema-wasm package version' - enginesHash: - required: true - description: 'prisma-engines commit to build' - npmDistTag: - required: true - default: 'latest' - description: 'npm dist-tag (e.g. latest or integration)' - -jobs: - build: - name: Build and publish @prisma/prisma-schema-wasm - runs-on: ubuntu-latest - steps: - - name: Print input - env: - THE_INPUT: '${{ toJson(github.event.inputs) }}' - run: | - echo $THE_INPUT - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.enginesHash }} - - uses: cachix/install-nix-action@v24 - - - name: Build - run: nix build .#prisma-schema-wasm - - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - # This is needed to be done manually because of `PACKAGE_DIR` used later - - name: Set up NPM token for publishing later - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - - name: Update version in package.json & Publish @prisma/prisma-schema-wasm - run: | - # Update version in package.json and return directory for later usage - PACKAGE_DIR=$( nix run .#renderPrismaSchemaWasmPackage ${{ github.event.inputs.enginesWrapperVersion }}) - npm publish "$PACKAGE_DIR" --access public --tag ${{ github.event.inputs.npmDistTag }} - # - # Failure handlers - # - - name: Set current job url in SLACK_FOOTER env var - if: ${{ failure() }} - run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV - - name: Slack Notification on Failure - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2.2.1 - env: - SLACK_TITLE: 'Building and publishing @prisma/prisma-schema-wasm failed :x:' - SLACK_COLOR: '#FF0000' - SLACK_CHANNEL: feed-prisma-schema-wasm-publish-failures - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WASM_FAILING }} diff --git a/.github/workflows/publish-query-engine-wasm.yml b/.github/workflows/publish-query-engine-wasm.yml deleted file mode 100644 index d10ca6709b2a..000000000000 --- a/.github/workflows/publish-query-engine-wasm.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Build and publish @prisma/query-engine-wasm -run-name: npm - release @prisma/query-engine-wasm@${{ github.event.inputs.packageVersion }} from ${{ github.event.inputs.enginesHash }} on ${{ github.event.inputs.npmDistTag }} - -concurrency: publish-query-engine-wasm - -on: - # usually triggered via GH Actions Workflow in prisma/engines-wrapper repo - workflow_dispatch: - inputs: - packageVersion: - required: true - description: 'New @prisma/query-engine-wasm package version' - enginesHash: - required: true - description: 'prisma-engines commit to build' - npmDistTag: - required: true - default: 'latest' - description: 'npm dist-tag (e.g. latest or integration)' - -jobs: - build: - name: Build and publish @prisma/query-engine-wasm - runs-on: ubuntu-latest - steps: - - name: Print input - run: echo "${{ toJson(github.event.inputs) }}" - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.enginesHash }} - - - uses: cachix/install-nix-action@v24 - - - name: Build @prisma/query-engine-wasm - run: nix run .#export-query-engine-wasm package ${{ github.event.inputs.packageVersion }} - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - - name: Set up NPM token for publishing - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - - name: Publish @prisma/query-engine-wasm - run: npm publish --access public --tag ${{ github.event.inputs.npmDistTag }} - working-directory: package - - # - # Failure handlers - # - - name: Set current job url in SLACK_FOOTER env var - if: ${{ failure() }} - run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV - - name: Slack Notification on Failure - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2.2.1 - env: - SLACK_TITLE: 'Building and publishing @prisma/query-engine-wasm failed :x:' - SLACK_COLOR: '#FF0000' - SLACK_CHANNEL: feed-prisma-query-engine-wasm-publish-failures - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WASM_FAILING }} diff --git a/.github/workflows/send-main-push-event.yml b/.github/workflows/send-main-push-event.yml deleted file mode 100644 index fa9294cba03f..000000000000 --- a/.github/workflows/send-main-push-event.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Trigger prisma-engines-builds run -run-name: Trigger prisma-engines-builds run for ${{ github.sha }} - -on: - push: - branches: - - main - -jobs: - send-commit-hash: - runs-on: ubuntu-22.04 - steps: - - run: echo "Sending event for commit $GITHUB_SHA" - - name: Workflow dispatch to prisma/prisma-engines-builds - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: .github/workflows/build-engines.yml - repo: prisma/prisma-engines-builds - token: ${{ secrets.BOT_TOKEN_PRISMA_ENGINES_BUILD }} - inputs: '{ "commit": "${{ github.sha }}" }' diff --git a/.github/workflows/test-compilation.yml b/.github/workflows/test-compilation.yml deleted file mode 100644 index 6451ca4eb10e..000000000000 --- a/.github/workflows/test-compilation.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "All crates: compilation" -on: - pull_request: - paths-ignore: - - "!.github/workflows/test-compilation.yml" - - ".github/**" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-crate-compilation: - name: "Check release compilation" - strategy: - fail-fast: false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - run: "cargo clean && cargo build --release -p schema-engine-cli" - name: "Compile Migration Engine" - - - run: "cargo clean && cargo build --release -p prisma-fmt" - name: "Compile prisma-fmt" - - - run: "cargo clean && cargo build --release -p query-engine" - name: "Compile Query Engine Binary" - - - run: "cargo clean && cargo build --release -p query-engine-node-api" - name: "Compile Query Engine Library" - - - name: "Check that Cargo.lock did not change" - run: "git diff --exit-code" diff --git a/.github/workflows/test-quaint.yml b/.github/workflows/test-quaint.yml deleted file mode 100644 index e1892562ae0b..000000000000 --- a/.github/workflows/test-quaint.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "Quaint: integration tests" -on: - push: - branches: - - main - pull_request: - paths: - - "quaint/**" - - "!.github/workflows/test-quaint.yml" - -jobs: - tests: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - features: - - "--lib --features=all" - env: - TEST_MYSQL: "mysql://root:prisma@localhost:3306/prisma" - TEST_MYSQL8: "mysql://root:prisma@localhost:3307/prisma" - TEST_MYSQL_MARIADB: "mysql://root:prisma@localhost:3308/prisma" - TEST_PSQL: "postgres://postgres:prisma@localhost:5432/postgres" - TEST_MSSQL: "jdbc:sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true" - TEST_CRDB: "postgresql://prisma@127.0.0.1:26259/postgres" - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ matrix.features }} - - - name: Start Databases - run: docker-compose -f docker-compose.yml up -d - working-directory: ./quaint - - - name: Sleep for 20s - uses: juliangruber/sleep-action@v1 - with: - time: 20s - - - name: Run tests - run: cargo test ${{ matrix.features }} - working-directory: ./quaint diff --git a/.github/workflows/test-query-engine-black-box.yml b/.github/workflows/test-query-engine-black-box.yml deleted file mode 100644 index 72dc415e4c88..000000000000 --- a/.github/workflows/test-query-engine-black-box.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: "QE: black-box tests" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - "!.github/workflows/test-query-engine-black-box.yml" - - ".github/**" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - strategy: - fail-fast: false - matrix: - database: - - name: "postgres16" - single_threaded: false - connector: "postgres" - # Arbitrary PostgreSQL version - # we opted for the most recent one, there is no need to have a matrix - version: "16" - - env: - LOG_LEVEL: "info" - LOG_QUERIES: "y" - RUST_LOG_FORMAT: "devel" - RUST_BACKTRACE: "1" - CLICOLOR_FORCE: "1" - CLOSED_TX_CLEANUP: "2" - SIMPLE_TEST_MODE: "1" - QUERY_BATCH_SIZE: "10" - TEST_RUNNER: "direct" - TEST_CONNECTOR: ${{ matrix.database.connector }} - TEST_CONNECTOR_VERSION: ${{ matrix.database.version }} - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - continue-on-error: true - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}" - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: "Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})" - run: make start-${{ matrix.database.name }} - - - uses: dtolnay/rust-toolchain@stable - - - run: export WORKSPACE_ROOT=$(pwd) && cargo build --package query-engine - env: - CLICOLOR_FORCE: 1 - - - run: export WORKSPACE_ROOT=$(pwd) && cargo test --package black-box-tests -- --test-threads=1 - env: - CLICOLOR_FORCE: 1 diff --git a/.github/workflows/test-query-engine-driver-adapters.yml b/.github/workflows/test-query-engine-driver-adapters.yml deleted file mode 100644 index 44761da11f77..000000000000 --- a/.github/workflows/test-query-engine-driver-adapters.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: "QE: driver-adapter integration tests" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - "!.github/workflows/test-query-engine-driver-adapters.yml" - - ".github/**" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - rust-query-engine-tests: - name: "${{ matrix.adapter.name }} ${{ matrix.partition }}" - - strategy: - fail-fast: false - matrix: - adapter: - - name: "planetscale (napi)" - setup_task: "dev-planetscale-js" - - name: "pg (napi)" - setup_task: "dev-pg-js" - - name: "neon (napi)" - setup_task: "dev-neon-js" - - name: "libsql (napi)" - setup_task: "dev-libsql-js" - - name: "planetscale (wasm)" - setup_task: "dev-planetscale-wasm" - - name: "pg (wasm)" - setup_task: "dev-pg-wasm" - - name: "neon (wasm)" - setup_task: "dev-neon-wasm" - - name: "libsql (wasm)" - setup_task: "dev-libsql-wasm" - node_version: ["18"] - partition: ["1/4", "2/4", "3/4", "4/4"] - env: - LOG_LEVEL: "info" # Set to "debug" to trace the query engine and node process running the driver adapter - LOG_QUERIES: "y" - RUST_LOG: "info" - RUST_LOG_FORMAT: "devel" - RUST_BACKTRACE: "1" - CLICOLOR_FORCE: "1" - CLOSED_TX_CLEANUP: "2" - SIMPLE_TEST_MODE: "1" - QUERY_BATCH_SIZE: "10" - WASM_BUILD_PROFILE: "profiling" # Include debug info for proper backtraces - WORKSPACE_ROOT: ${{ github.workspace }} - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: "Setup Node.js" - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node_version }} - - - name: "Setup pnpm" - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: "Get pnpm store directory" - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: "Login to Docker Hub" - uses: docker/login-action@v3 - continue-on-error: true - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}" - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract Branch Name - id: extract-branch - run: | - branch="$(git show -s --format=%s | grep -o "DRIVER_ADAPTERS_BRANCH=[^ ]*" | cut -f2 -d=)" - if [ -n "$branch" ]; then - echo "Using $branch branch of driver adapters" - echo "DRIVER_ADAPTERS_BRANCH=$branch" >> "$GITHUB_ENV" - fi - - - uses: cachix/install-nix-action@v24 - - uses: taiki-e/install-action@nextest - - - run: make ${{ matrix.adapter.setup_task }} - - - name: "Run tests" - run: cargo nextest run --package query-engine-tests --test-threads=1 --partition hash:${{ matrix.partition }} diff --git a/.github/workflows/test-query-engine.yml b/.github/workflows/test-query-engine.yml deleted file mode 100644 index 8f1b5964db36..000000000000 --- a/.github/workflows/test-query-engine.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: "QE: integration tests" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - "!.github/workflows/test-query-engine.yml" - - ".github/**" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - rust-query-engine-tests: - name: "${{ matrix.database.name }} - ${{ matrix.engine_protocol }} ${{ matrix.partition }}" - - strategy: - fail-fast: false - matrix: - database: - - name: "vitess_8_0" - single_threaded: true - connector: "vitess" - version: "8.0" - # Arbitrary PostgreSQL version - # we opted for the most recent one, there is no need to have a matrix - - name: "postgres16" - single_threaded: true - connector: "postgres" - version: "16" - - name: "mssql_2022" - single_threaded: false - connector: "sqlserver" - version: "2022" - - name: "sqlite" - single_threaded: false - connector: "sqlite" - version: "3" - - name: "mongodb_4_2" - single_threaded: true - connector: "mongodb" - version: "4.2" - - name: "cockroach_23_1" - single_threaded: false - connector: "cockroachdb" - version: "23.1" - - name: "cockroach_22_2" - single_threaded: false - connector: "cockroachdb" - version: "22.2" - - name: "cockroach_22_1_0" - single_threaded: false - connector: "cockroachdb" - version: "22.1" - engine_protocol: [graphql, json] - partition: ["1/4", "2/4", "3/4", "4/4"] - - env: - LOG_LEVEL: "info" - LOG_QUERIES: "y" - RUST_LOG_FORMAT: "devel" - RUST_BACKTRACE: "1" - CLICOLOR_FORCE: "1" - CLOSED_TX_CLEANUP: "2" - SIMPLE_TEST_MODE: "1" - QUERY_BATCH_SIZE: "10" - TEST_RUNNER: "direct" - TEST_CONNECTOR: ${{ matrix.database.connector }} - TEST_CONNECTOR_VERSION: ${{ matrix.database.version }} - PRISMA_ENGINE_PROTOCOL: ${{ matrix.engine_protocol }} - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: taiki-e/install-action@nextest - - - name: Login to Docker Hub - uses: docker/login-action@v3 - continue-on-error: true - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}" - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: "Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})" - run: make start-${{ matrix.database.name }} - - - run: export WORKSPACE_ROOT=$(pwd) && cargo nextest run -p query-engine-tests --partition hash:${{ matrix.partition }} --test-threads=1 - if: ${{ matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - - - run: export WORKSPACE_ROOT=$(pwd) && cargo nextest run -p query-engine-tests --partition hash:${{ matrix.partition }} --test-threads=8 - if: ${{ !matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 diff --git a/.github/workflows/test-schema-engine.yml b/.github/workflows/test-schema-engine.yml deleted file mode 100644 index dd28f40d2534..000000000000 --- a/.github/workflows/test-schema-engine.yml +++ /dev/null @@ -1,249 +0,0 @@ -name: "SE: integration tests" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - ".github/**" - - "!.github/workflows/test-schema-engine.yml" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - # Specific - - "query-engine/**" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-mongodb-schema-connector: - name: "${{ matrix.database.name }}" - strategy: - fail-fast: false - matrix: - database: - - name: "mongodb42" - url: "mongodb://prisma:prisma@localhost:27016/?authSource=admin&retryWrites=true" - - name: "mongodb44" - url: "mongodb://prisma:prisma@localhost:27017/?authSource=admin&retryWrites=true" - - name: "mongodb5" - url: "mongodb://prisma:prisma@localhost:27018/?authSource=admin&retryWrites=true" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - 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: "Start ${{ matrix.database.name }}" - run: make start-${{ matrix.database.name }}-single - - - run: cargo nextest run -p mongodb-schema-connector - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - test-linux: - name: "${{ matrix.database.name }}" - - strategy: - fail-fast: false - matrix: - database: - - name: mssql_2017 - url: "sqlserver://localhost:1434;database=master;user=SA;password=;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED" - - name: mssql_2019 - url: "sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED" - - name: mssql_2022 - url: "sqlserver://localhost:1435;database=master;user=SA;password=;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_8 - url: "mysql://root:prisma@localhost:3307" - - name: mysql_mariadb - url: "mysql://root:prisma@localhost:3308" - - name: postgres9 - url: "postgresql://postgres:prisma@localhost:5431" - - name: postgres10 - url: "postgresql://postgres:prisma@localhost:5432" - - name: postgres11 - url: "postgresql://postgres:prisma@localhost:5433" - - 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: postgres16 - url: "postgresql://postgres:prisma@localhost:5439" - - 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: sqlite - url: sqlite - - 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 - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: taiki-e/install-action@nextest - - - name: Login to Docker Hub - uses: docker/login-action@v3 - continue-on-error: true - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}" - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: "Start ${{ matrix.database.name }}" - run: make start-${{ matrix.database.name }} - - - run: cargo nextest run -p sql-introspection-tests - if: ${{ !matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - - run: cargo nextest run -p sql-schema-describer - if: ${{ !matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - - run: cargo nextest run -p sql-migration-tests - if: ${{ !matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - RUST_LOG: debug - - - run: cargo nextest run -p schema-engine-cli - if: ${{ !matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - # - # Vitess tests - # - - run: cargo nextest run -p sql-introspection-tests --test-threads=1 - if: ${{ matrix.database.is_vitess }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }} - - - run: cargo nextest run -p sql-migration-tests --test-threads=1 - if: ${{ matrix.database.is_vitess }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }} - RUST_LOG: debug - - - run: cargo nextest run -p schema-engine-cli --test-threads=1 - if: ${{ matrix.database.is_vitess }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }} - - # - # Single threaded tests (excluding Vitess) - # - - run: cargo nextest run -p sql-schema-describer --test-threads=1 - if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - - run: cargo nextest run -p sql-introspection-tests --test-threads=1 - if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - - run: cargo nextest run -p sql-migration-tests --test-threads=1 - if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - RUST_LOG: debug - - - run: cargo nextest run -p schema-engine-cli --test-threads=1 - if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }} - env: - CLICOLOR_FORCE: 1 - TEST_DATABASE_URL: ${{ matrix.database.url }} - - test-windows: - strategy: - fail-fast: false - matrix: - db: - - name: mysql - 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.db.name }} on Windows" - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: taiki-e/install-action@nextest - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} - - - name: Install ${{ matrix.db.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.db.name }} - sudo mysqld --install - sudo sc start MySQL - - - name: Run tests - run: cargo nextest run -p sql-migration-tests - env: - TEST_DATABASE_URL: ${{ matrix.db.url }} diff --git a/.github/workflows/test-unit-tests.yml b/.github/workflows/test-unit-tests.yml deleted file mode 100644 index 39f1dcb7e32d..000000000000 --- a/.github/workflows/test-unit-tests.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: "All crates: unit tests" -on: - push: - branches: - - main - pull_request: - paths-ignore: - - ".github/**" - - "!.github/workflows/test-unit-tests.yml" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - strategy: - fail-fast: false - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - run: | - cargo test --workspace \ - --exclude=quaint \ - --exclude=query-engine \ - --exclude=query-engine-node-api \ - --exclude=black-box-tests \ - --exclude=query-engine-tests \ - --exclude=sql-migration-tests \ - --exclude=schema-engine-cli \ - --exclude=sql-schema-describer \ - --exclude=sql-introspection-tests \ - --exclude=mongodb-schema-connector - env: - CLICOLOR_FORCE: 1 diff --git a/.github/workflows/wasm-size.yml b/.github/workflows/wasm-size.yml deleted file mode 100644 index 4b38646712e4..000000000000 --- a/.github/workflows/wasm-size.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: "QE: WASM size" -on: - pull_request: - paths-ignore: - - ".github/**" - - "!.github/workflows/wasm-size.yml" - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - pr-wasm-size: - name: calculate module size (pr) - runs-on: ubuntu-latest - outputs: - size: ${{ steps.measure.outputs.size }} - size_gz: ${{ steps.measure.outputs.size_gz }} - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - uses: cachix/install-nix-action@v24 - - - name: Build and measure PR branch - id: measure - run: | - nix build -L .#query-engine-wasm .#query-engine-wasm-gz - - echo "size=$(wc --bytes < ./result/query_engine_bg.wasm)" >> $GITHUB_OUTPUT - echo "size_gz=$(wc --bytes < ./result-1/query_engine_bg.wasm.gz)" >> $GITHUB_OUTPUT - - base-wasm-size: - name: calculate module size (main) - runs-on: ubuntu-latest - outputs: - size: ${{ steps.measure.outputs.size }} - size_gz: ${{ steps.measure.outputs.size_gz }} - steps: - - name: Checkout base branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.sha }} - - - uses: cachix/install-nix-action@v24 - - - name: Build and measure base branch - id: measure - run: | - nix build -L .#query-engine-wasm .#query-engine-wasm-gz - - echo "size=$(wc --bytes < ./result/query_engine_bg.wasm)" >> $GITHUB_OUTPUT - echo "size_gz=$(wc --bytes < ./result-1/query_engine_bg.wasm.gz)" >> $GITHUB_OUTPUT - - report-diff: - name: report module size - runs-on: ubuntu-latest - needs: - - pr-wasm-size - - base-wasm-size - - steps: - - name: Compute difference - id: compute - run: | - base=$(echo "${{ needs.base-wasm-size.outputs.size }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) - base_gz=$(echo "${{ needs.base-wasm-size.outputs.size_gz }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) - pr=$(echo "${{ needs.pr-wasm-size.outputs.size }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) - pr_gz=$(echo "${{ needs.pr-wasm-size.outputs.size_gz }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) - - diff=$(echo "$((${{ needs.pr-wasm-size.outputs.size }} - ${{ needs.base-wasm-size.outputs.size }}))" | numfmt --format '%.3f' --to=iec-i --suffix=B) - diff_gz=$(echo "$((${{ needs.pr-wasm-size.outputs.size_gz }} - ${{ needs.base-wasm-size.outputs.size_gz }}))" | numfmt --format '%.3f' --to=iec-i --suffix=B) - - echo "base=$base" >> $GITHUB_OUTPUT - echo "base_gz=$base_gz" >> $GITHUB_OUTPUT - - echo "pr=$pr" >> $GITHUB_OUTPUT - echo "pr_gz=$pr_gz" >> $GITHUB_OUTPUT - - echo "diff=$diff" >> $GITHUB_OUTPUT - echo "diff_gz=$diff_gz" >> $GITHUB_OUTPUT - - - name: Find past report comment - uses: peter-evans/find-comment@v2 - id: findReportComment - with: - issue-number: ${{ github.event.pull_request.number }} - body-includes: "" - - - name: Create or update report - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.findReportComment.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - - ### WASM Size - - |Engine | This PR | Base branch | Diff - |--------------|-----------------------------------|--------------------------------------|------------------------------------ - | WASM | ${{ steps.compute.outputs.pr}} | ${{ steps.compute.outputs.base}} | ${{ steps.compute.outputs.diff}} - | WASM (gzip) | ${{ steps.compute.outputs.pr_gz}} | ${{ steps.compute.outputs.base_gz}} | ${{ steps.compute.outputs.diff_gz}} - edit-mode: replace