From 0eead1d27772faf1df2bae3a06f1edb61302f339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Galeran?= Date: Fri, 6 Oct 2023 15:51:34 +0200 Subject: [PATCH] ci: better paths-ignore for workflows (#4328) --- .github/workflows/benchmark.yml | 4 +- .github/workflows/build-wasm.yml | 14 ++-- .github/workflows/compilation.yml | 26 +++---- .github/workflows/formatting.yml | 4 +- .github/workflows/query-engine-black-box.yml | 34 ++++----- .../query-engine-driver-adapters.yml | 50 ++++++------- .github/workflows/query-engine.yml | 72 ++++++++++--------- .github/workflows/schema-engine.yml | 68 +++++++++--------- 8 files changed, 143 insertions(+), 129 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bc2feb1b7b8d..4dbfa4855fc9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -5,6 +5,8 @@ on: - main pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/benchmark.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -17,7 +19,7 @@ concurrency: jobs: benchmark: - name: "Run benchmarks on Linux" + name: 'Run benchmarks on Linux' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 4d715d57afd7..7969cd2dd462 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -5,15 +5,17 @@ on: - main pull_request: paths-ignore: - - ".buildkite/**" - - "*.md" - - "LICENSE" - - "CODEOWNERS" - - "renovate.json" + - '.github/**' + - '!.github/workflows/build-wasm.yml' + - '.buildkite/**' + - '*.md' + - 'LICENSE' + - 'CODEOWNERS' + - 'renovate.json' jobs: build: - name: "prisma-schema-wasm build ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}" + name: 'prisma-schema-wasm build ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 713fb1a86505..d9f81f47772b 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -1,7 +1,9 @@ -name: "Release binary compilation test" +name: 'Release binary compilation test' on: pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/compilation.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -14,7 +16,7 @@ concurrency: jobs: test-crate-compilation: - name: "Compile top level crates on Linux" + name: 'Compile top level crates on Linux' strategy: fail-fast: false runs-on: ubuntu-latest @@ -22,17 +24,17 @@ jobs: - 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 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 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' + name: 'Compile Query Engine Binary' - - run: "cargo clean && cargo build --release -p query-engine-node-api" - name: "Compile Query Engine Library" + - 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" + - name: 'Check that Cargo.lock did not change' + run: 'git diff --exit-code' diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 107d842eef6b..50b635544b91 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -5,6 +5,8 @@ on: - main pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/formatting.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -19,7 +21,7 @@ jobs: clippy: runs-on: ubuntu-latest env: - RUSTFLAGS: "-Dwarnings" + RUSTFLAGS: '-Dwarnings' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/query-engine-black-box.yml b/.github/workflows/query-engine-black-box.yml index 163ee3ad0141..05e487c779bd 100644 --- a/.github/workflows/query-engine-black-box.yml +++ b/.github/workflows/query-engine-black-box.yml @@ -5,6 +5,8 @@ on: - main pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/query-engine-black-box.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -17,27 +19,27 @@ concurrency: jobs: rust-tests: - name: "Test query-engine as a black-box" + name: 'Test query-engine as a black-box' strategy: fail-fast: false matrix: database: - - name: "postgres15" + - name: 'postgres15' single_threaded: false - connector: "postgres" - version: "15" + connector: 'postgres' + version: '15' 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" + 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 }} @@ -52,15 +54,15 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})" + - 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 + - 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 + - run: export WORKSPACE_ROOT=$(pwd) && cargo test --package black-box-tests -- --test-threads=1 env: CLICOLOR_FORCE: 1 diff --git a/.github/workflows/query-engine-driver-adapters.yml b/.github/workflows/query-engine-driver-adapters.yml index f4207e2a6d51..d3ec9acb4e58 100644 --- a/.github/workflows/query-engine-driver-adapters.yml +++ b/.github/workflows/query-engine-driver-adapters.yml @@ -5,6 +5,8 @@ on: - main pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/query-engine-driver-adapters.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -17,51 +19,51 @@ concurrency: jobs: rust-query-engine-tests: - name: "Test `${{ matrix.adapter.name }}` on node v${{ matrix.node_version }}" + name: 'Test `${{ matrix.adapter.name }}` on node v${{ matrix.node_version }}' strategy: fail-fast: false matrix: adapter: - - name: "pg" - setup_task: "dev-pg-postgres13" - - name: "neon:ws" - setup_task: "dev-neon-ws-postgres13" - - name: "libsql" - setup_task: "dev-libsql-sqlite" - node_version: ["18"] + - name: 'pg' + setup_task: 'dev-pg-postgres13' + - name: 'neon:ws' + setup_task: 'dev-neon-ws-postgres13' + - name: 'libsql' + setup_task: 'dev-libsql-sqlite' + node_version: ['18'] 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" + 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' WORKSPACE_ROOT: ${{ github.workspace }} runs-on: buildjet-16vcpu-ubuntu-2004 steps: - uses: actions/checkout@v4 - - name: "Setup Node.js" + - name: 'Setup Node.js' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node_version }} - - name: "Setup pnpm" + - name: 'Setup pnpm' uses: pnpm/action-setup@v2 with: version: 8 - - name: "Get pnpm store directory" + - name: 'Get pnpm store directory' shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - name: "Login to Docker Hub" + - name: 'Login to Docker Hub' uses: docker/login-action@v2 continue-on-error: true with: @@ -72,7 +74,5 @@ jobs: - uses: dtolnay/rust-toolchain@stable - - name: "Run tests" - run: cargo test --package query-engine-tests -- --test-threads=1 - - + - name: 'Run tests' + run: cargo test --package query-engine-tests -- --test-threads=1 diff --git a/.github/workflows/query-engine.yml b/.github/workflows/query-engine.yml index 6ed522c94f13..3f5ad954d24e 100644 --- a/.github/workflows/query-engine.yml +++ b/.github/workflows/query-engine.yml @@ -5,6 +5,8 @@ on: - main pull_request: paths-ignore: + - '.github/**' + - '!.github/workflows/query-engine.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -17,56 +19,56 @@ concurrency: jobs: rust-query-engine-tests: - name: "Test ${{ matrix.database.name }} (${{ matrix.engine_protocol }}) on Linux" + name: 'Test ${{ matrix.database.name }} (${{ matrix.engine_protocol }}) on Linux' strategy: fail-fast: false matrix: database: - - name: "vitess_5_7" + - name: 'vitess_5_7' single_threaded: true - connector: "vitess" - version: "5.7" - - name: "vitess_8_0" + connector: 'vitess' + version: '5.7' + - name: 'vitess_8_0' single_threaded: true - connector: "vitess" - version: "8.0" - - name: "postgres15" + connector: 'vitess' + version: '8.0' + - name: 'postgres15' single_threaded: true - connector: "postgres" - version: "15" - - name: "mssql_2022" + connector: 'postgres' + version: '15' + - name: 'mssql_2022' single_threaded: false - connector: "sqlserver" - version: "2022" - - name: "mongodb_4_2" + connector: 'sqlserver' + version: '2022' + - name: 'mongodb_4_2' single_threaded: true - connector: "mongodb" - version: "4.2" - - name: "cockroach_23_1" + connector: 'mongodb' + version: '4.2' + - name: 'cockroach_23_1' single_threaded: false - connector: "cockroachdb" - version: "23.1" - - name: "cockroach_22_2" + connector: 'cockroachdb' + version: '23.1' + - name: 'cockroach_22_2' single_threaded: false - connector: "cockroachdb" - version: "22.2" - - name: "cockroach_22_1_0" + connector: 'cockroachdb' + version: '22.2' + - name: 'cockroach_22_1_0' single_threaded: false - connector: "cockroachdb" - version: "22.1" + connector: 'cockroachdb' + version: '22.1' engine_protocol: [graphql, json] 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" + 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 }} @@ -82,7 +84,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})" + - name: 'Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})' run: make start-${{ matrix.database.name }} - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/schema-engine.yml b/.github/workflows/schema-engine.yml index 20c263dc17d0..e9b69c748246 100644 --- a/.github/workflows/schema-engine.yml +++ b/.github/workflows/schema-engine.yml @@ -6,6 +6,8 @@ on: pull_request: paths-ignore: # Generic + - '.github/**' + - '!.github/workflows/schema-engine.yml' - '.buildkite/**' - '*.md' - 'LICENSE' @@ -20,17 +22,17 @@ concurrency: jobs: test-mongodb-schema-connector: - name: "Test ${{ matrix.database.name }} on Linux" + name: 'Test ${{ matrix.database.name }} on Linux' 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" + - 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 @@ -43,7 +45,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "Start ${{ matrix.database.name }}" + - name: 'Start ${{ matrix.database.name }}' run: make start-${{ matrix.database.name }}-single - run: cargo test -p mongodb-schema-connector @@ -52,54 +54,54 @@ jobs: TEST_DATABASE_URL: ${{ matrix.database.url }} test-linux: - name: "Test ${{ matrix.database.name }} on Linux" + name: 'Test ${{ matrix.database.name }} on Linux' 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" + 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" + url: 'sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED' - name: mysql_5_6 - url: "mysql://root:prisma@localhost:3309" + url: 'mysql://root:prisma@localhost:3309' - name: mysql_5_7 - url: "mysql://root:prisma@localhost:3306" + url: 'mysql://root:prisma@localhost:3306' - name: mysql_8 - url: "mysql://root:prisma@localhost:3307" + url: 'mysql://root:prisma@localhost:3307' - name: mysql_mariadb - url: "mysql://root:prisma@localhost:3308" + url: 'mysql://root:prisma@localhost:3308' - name: postgres9 - url: "postgresql://postgres:prisma@localhost:5431" + url: 'postgresql://postgres:prisma@localhost:5431' - name: postgres10 - url: "postgresql://postgres:prisma@localhost:5432" + url: 'postgresql://postgres:prisma@localhost:5432' - name: postgres11 - url: "postgresql://postgres:prisma@localhost:5433" + url: 'postgresql://postgres:prisma@localhost:5433' - name: postgres12 - url: "postgresql://postgres:prisma@localhost:5434" + url: 'postgresql://postgres:prisma@localhost:5434' - name: postgres13 - url: "postgresql://postgres:prisma@localhost:5435" + url: 'postgresql://postgres:prisma@localhost:5435' - name: postgres14 - url: "postgresql://postgres:prisma@localhost:5437" + url: 'postgresql://postgres:prisma@localhost:5437' - name: postgres15 - url: "postgresql://postgres:prisma@localhost:5438" + url: 'postgresql://postgres:prisma@localhost:5438' - name: cockroach_23_1 - url: "postgresql://prisma@localhost:26260" + url: 'postgresql://prisma@localhost:26260' - name: cockroach_22_2 - url: "postgresql://prisma@localhost:26259" + url: 'postgresql://prisma@localhost:26259' - name: cockroach_22_1_0 - url: "postgresql://prisma@localhost:26257" + url: 'postgresql://prisma@localhost:26257' - name: sqlite url: sqlite - name: vitess_5_7 - url: "mysql://root:prisma@localhost:33577/test" - shadow_database_url: "mysql://root:prisma@localhost:33578/shadow" + url: 'mysql://root:prisma@localhost:33577/test' + shadow_database_url: 'mysql://root:prisma@localhost:33578/shadow' is_vitess: true single_threaded: true - name: vitess_8_0 - url: "mysql://root:prisma@localhost:33807/test" - shadow_database_url: "mysql://root:prisma@localhost:33808/shadow" + url: 'mysql://root:prisma@localhost:33807/test' + shadow_database_url: 'mysql://root:prisma@localhost:33808/shadow' is_vitess: true single_threaded: true @@ -115,7 +117,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "Start ${{ matrix.database.name }}" + - name: 'Start ${{ matrix.database.name }}' run: make start-${{ matrix.database.name }} - run: cargo test -p sql-introspection-tests @@ -196,9 +198,9 @@ jobs: matrix: db: - name: mysql - url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60" + url: 'mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60' - name: mariadb - url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60" + url: 'mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60' rust: - stable os: @@ -206,7 +208,7 @@ jobs: runs-on: ${{ matrix.os }} - name: "Test ${{ matrix.db.name }} on Windows" + name: 'Test ${{ matrix.db.name }} on Windows' steps: - uses: actions/checkout@v4