Skip to content

Commit

Permalink
ci: better paths-ignore for workflows (#4328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 authored Oct 6, 2023
1 parent 01b5c95 commit 0eead1d
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 129 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/benchmark.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
Expand All @@ -17,7 +19,7 @@ concurrency:

jobs:
benchmark:
name: "Run benchmarks on Linux"
name: 'Run benchmarks on Linux'

runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -14,25 +16,25 @@ 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
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 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'
4 changes: 3 additions & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/formatting.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
Expand All @@ -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
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/query-engine-black-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/query-engine-black-box.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
Expand All @@ -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 }}

Expand All @@ -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
50 changes: 25 additions & 25 deletions .github/workflows/query-engine-driver-adapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/query-engine-driver-adapters.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
Expand All @@ -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:
Expand All @@ -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
72 changes: 37 additions & 35 deletions .github/workflows/query-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/query-engine.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
Loading

0 comments on commit 0eead1d

Please sign in to comment.