From 23423faa44525ae53278fc0ef7f33f200425b7f8 Mon Sep 17 00:00:00 2001 From: mysticmind Date: Fri, 23 Jan 2026 20:08:32 +0530 Subject: [PATCH 1/2] Parallelize CI runs by splitting event sourcing tests to a seperate CI workflow --- ...do-ci-build-pg15-jsonnet-eventsourcing.yml | 92 +++++++++++++++++++ .../on-push-do-ci-build-pg15-jsonnet.yml | 5 - ...-pgLatest-systemtextjson-eventsourcing.yml | 92 +++++++++++++++++++ ...sh-do-ci-build-pgLatest-systemtextjson.yml | 5 - 4 files changed, 184 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml create mode 100644 .github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml diff --git a/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml b/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml new file mode 100644 index 0000000000..0a54995c2f --- /dev/null +++ b/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml @@ -0,0 +1,92 @@ +name: Build & Test - NET8 - PG15 - Newtonsoft - EventSourcing + +on: + push: + branches: + - master + - "7.0" + paths-ignore: + - 'documentation/**' + - 'docs/**' + - 'azure-pipelines.yml' + pull_request: + branches: + - master + - "7.0" + paths-ignore: + - 'documentation/**' + - 'docs/**' + - 'azure-pipelines.yml' + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + node_version: 24.x + pg_db: marten_testing + pg_user: postgres + CONFIGURATION: Release + FRAMEWORK: net8.0 + DISABLE_TEST_PARALLELIZATION: true + DEFAULT_SERIALIZER: "Newtonsoft" + NUKE_TELEMETRY_OPTOUT: true + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 20 + + services: + postgres: + image: postgres:15-alpine + ports: + - 5432:5432 + env: + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: ${{ env.pg_db }} + NAMEDATALEN: 150 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + --user postgres + + steps: + - uses: actions/checkout@v6 + + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x + + - name: Install .NET Aspire workload + run: | + dotnet workload update + dotnet workload install aspire + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: ${{ env.node_version }} + + - name: Optimize database for running tests faster + run: | + PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}}) + docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfsync = off' >> /var/lib/postgresql/data/postgresql.conf" + docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfull_page_writes = off' >> /var/lib/postgresql/data/postgresql.conf" + docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nsynchronous_commit = off' >> /var/lib/postgresql/data/postgresql.conf" + docker container restart $PG_CONTAINER_NAME + shell: bash + + - name: compile + run: ./build.sh compile + shell: bash + + - name: test-event-sourcing + if: ${{ success() || failure() }} + run: ./build.sh test-event-sourcing + shell: bash + diff --git a/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml b/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml index ded47763e5..a34b9291dc 100644 --- a/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml +++ b/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml @@ -100,11 +100,6 @@ jobs: run: ./build.sh test-document-db shell: bash - - name: test-event-sourcing - if: ${{ success() || failure() }} - run: ./build.sh test-event-sourcing - shell: bash - - name: test-cli if: ${{ success() || failure() }} run: ./build.sh test-cli diff --git a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml new file mode 100644 index 0000000000..f7fc36693e --- /dev/null +++ b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml @@ -0,0 +1,92 @@ +name: Build & Test - NET10 - PGLatest - System.Text.Json - Event Sourcing + +on: + push: + branches: + - master + - "7.0" + paths-ignore: + - 'documentation/**' + - 'docs/**' + - 'azure-pipelines.yml' + pull_request: + branches: + - master + - "7.0" + paths-ignore: + - 'documentation/**' + - 'docs/**' + - 'azure-pipelines.yml' + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + node_version: 24.x + pg_db: marten_testing + pg_user: postgres + CONFIGURATION: Release + FRAMEWORK: net10.0 + DISABLE_TEST_PARALLELIZATION: true + DEFAULT_SERIALIZER: "SystemTextJson" + NUKE_TELEMETRY_OPTOUT: true + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 20 + + services: + postgres: + image: postgres:latest + ports: + - 5432:5432 + env: + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: ${{ env.pg_db }} + NAMEDATALEN: 150 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + --user postgres + + steps: + - uses: actions/checkout@v6 + + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x + + - name: Install .NET Aspire workload + run: | + dotnet workload update + dotnet workload install aspire + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: ${{ env.node_version }} + + # - name: Optimize database for running tests faster + # run: | + # PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}}) + # docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfsync = off' >> /var/lib/postgresql/data/postgresql.conf" + # docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfull_page_writes = off' >> /var/lib/postgresql/data/postgresql.conf" + # docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nsynchronous_commit = off' >> /var/lib/postgresql/data/postgresql.conf" + # docker container restart $PG_CONTAINER_NAME + # shell: bash + + - name: compile + run: ./build.sh compile + shell: bash + + - name: test-event-sourcing + if: ${{ success() || failure() }} + run: ./build.sh test-event-sourcing + shell: bash + diff --git a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml index 3101f9c041..b72daafb92 100644 --- a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml +++ b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml @@ -100,11 +100,6 @@ jobs: run: ./build.sh test-document-db shell: bash - - name: test-event-sourcing - if: ${{ success() || failure() }} - run: ./build.sh test-event-sourcing - shell: bash - - name: test-cli if: ${{ success() || failure() }} run: ./build.sh test-cli From 9b9b2bce2661d65d66140ac670daa417235076b0 Mon Sep 17 00:00:00 2001 From: mysticmind Date: Fri, 23 Jan 2026 20:30:28 +0530 Subject: [PATCH 2/2] Remove node install steps from CI workflows pertaining to unit tests --- .../on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml | 6 ------ .github/workflows/on-push-do-ci-build-pg15-jsonnet.yml | 6 ------ ...sh-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml | 6 ------ .../on-push-do-ci-build-pgLatest-systemtextjson.yml | 6 ------ 4 files changed, 24 deletions(-) diff --git a/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml b/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml index 0a54995c2f..d03b9d58bd 100644 --- a/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml +++ b/.github/workflows/on-push-do-ci-build-pg15-jsonnet-eventsourcing.yml @@ -21,7 +21,6 @@ on: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - node_version: 24.x pg_db: marten_testing pg_user: postgres CONFIGURATION: Release @@ -67,11 +66,6 @@ jobs: dotnet workload update dotnet workload install aspire - - name: Install Node.js - uses: actions/setup-node@v6 - with: - node-version: ${{ env.node_version }} - - name: Optimize database for running tests faster run: | PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}}) diff --git a/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml b/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml index a34b9291dc..b6520e3c48 100644 --- a/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml +++ b/.github/workflows/on-push-do-ci-build-pg15-jsonnet.yml @@ -21,7 +21,6 @@ on: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - node_version: 24.x pg_db: marten_testing pg_user: postgres CONFIGURATION: Release @@ -67,11 +66,6 @@ jobs: dotnet workload update dotnet workload install aspire - - name: Install Node.js - uses: actions/setup-node@v6 - with: - node-version: ${{ env.node_version }} - - name: Optimize database for running tests faster run: | PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}}) diff --git a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml index f7fc36693e..acc0e73f79 100644 --- a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml +++ b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson-eventsourcing.yml @@ -21,7 +21,6 @@ on: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - node_version: 24.x pg_db: marten_testing pg_user: postgres CONFIGURATION: Release @@ -67,11 +66,6 @@ jobs: dotnet workload update dotnet workload install aspire - - name: Install Node.js - uses: actions/setup-node@v6 - with: - node-version: ${{ env.node_version }} - # - name: Optimize database for running tests faster # run: | # PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}}) diff --git a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml index b72daafb92..77a2694d39 100644 --- a/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml +++ b/.github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml @@ -21,7 +21,6 @@ on: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - node_version: 24.x pg_db: marten_testing pg_user: postgres CONFIGURATION: Release @@ -67,11 +66,6 @@ jobs: dotnet workload update dotnet workload install aspire - - name: Install Node.js - uses: actions/setup-node@v6 - with: - node-version: ${{ env.node_version }} - # - name: Optimize database for running tests faster # run: | # PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})