From f674c42010133f2f28327d2d647fcef436c49b66 Mon Sep 17 00:00:00 2001 From: William Chen Date: Thu, 14 May 2026 23:07:48 +0800 Subject: [PATCH 1/4] refactor: streamline CI workflows for unit and integration tests with matrix strategy --- .github/workflows/ci-test.yml | 27 +++++++++++++++++++-------- .github/workflows/release.yml | 34 +++++++++------------------------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 44ab0074..0d2105b2 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -8,17 +8,28 @@ on: - "docs/**" jobs: - test: + unit: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Set up Go - uses: actions/setup-go@v6 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: go-version: "1.24" + - name: Run unit tests + run: go test -short -v ./... - - name: Run tests + integration: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pg-version: ["14", "15", "16", "17", "18"] + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 + with: + go-version: "1.24" + - name: Run integration tests (PG ${{ matrix.pg-version }}) + env: + PGSCHEMA_POSTGRES_VERSION: ${{ matrix.pg-version }} run: go test -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 302ea653..3e1ad4fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,13 @@ permissions: contents: write jobs: - # Test job runs first with all Postgres versions + # Test job runs first with all Postgres versions in parallel test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pg-version: ["14", "15", "16", "17", "18"] steps: - name: Checkout uses: actions/checkout@v6 @@ -27,30 +31,10 @@ jobs: with: go-version: "1.24" - - name: Run tests (PostgreSQL 18) - run: | - echo "Testing with PostgreSQL 18" - PGSCHEMA_POSTGRES_VERSION=18 go test -v ./... - - - name: Run tests (PostgreSQL 17) - run: | - echo "Testing with PostgreSQL 17" - PGSCHEMA_POSTGRES_VERSION=17 go test -v ./... - - - name: Run tests (PostgreSQL 16) - run: | - echo "Testing with PostgreSQL 16" - PGSCHEMA_POSTGRES_VERSION=16 go test -v ./... - - - name: Run tests (PostgreSQL 15) - run: | - echo "Testing with PostgreSQL 15" - PGSCHEMA_POSTGRES_VERSION=15 go test -v ./... - - - name: Run tests (PostgreSQL 14) - run: | - echo "Testing with PostgreSQL 14" - PGSCHEMA_POSTGRES_VERSION=14 go test -v ./... + - name: Run tests (PostgreSQL ${{ matrix.pg-version }}) + env: + PGSCHEMA_POSTGRES_VERSION: ${{ matrix.pg-version }} + run: go test -v ./... # Build binaries using native Go cross-compilation build-binaries: From 6df6f1a1707d76eb1c80cebfe8e0471cca687f07 Mon Sep 17 00:00:00 2001 From: William Chen Date: Thu, 14 May 2026 23:32:33 +0800 Subject: [PATCH 2/4] fix: ensure integration tests depend on unit tests in CI workflow --- .github/workflows/ci-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 0d2105b2..730e7098 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -19,6 +19,7 @@ jobs: run: go test -short -v ./... integration: + needs: unit runs-on: ubuntu-latest strategy: fail-fast: false @@ -30,6 +31,7 @@ jobs: with: go-version: "1.24" - name: Run integration tests (PG ${{ matrix.pg-version }}) + env: PGSCHEMA_POSTGRES_VERSION: ${{ matrix.pg-version }} run: go test -v ./... From 3130e922b5179dcb970ec33275a8ba88e9c68422 Mon Sep 17 00:00:00 2001 From: William Chen Date: Thu, 14 May 2026 23:38:53 +0800 Subject: [PATCH 3/4] refactor: consolidate unit and integration tests into a single CI job --- .github/workflows/ci-test.yml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 730e7098..daacfc4c 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -8,30 +8,17 @@ on: - "docs/**" jobs: - unit: + test: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: "1.24" - - name: Run unit tests - run: go test -short -v ./... - integration: - needs: unit - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - pg-version: ["14", "15", "16", "17", "18"] steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 with: go-version: "1.24" - - name: Run integration tests (PG ${{ matrix.pg-version }}) - - env: - PGSCHEMA_POSTGRES_VERSION: ${{ matrix.pg-version }} - run: go test -v ./... + + - name: Run tests + run: go test -v ./... \ No newline at end of file From 413e19a024033ed62a5d87fe95e983cbbfed605b Mon Sep 17 00:00:00 2001 From: William Chen Date: Thu, 14 May 2026 23:42:05 +0800 Subject: [PATCH 4/4] revert: undo unnecessary trailing newline change in ci-test.yml --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index daacfc4c..44ab0074 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -21,4 +21,4 @@ jobs: go-version: "1.24" - name: Run tests - run: go test -v ./... \ No newline at end of file + run: go test -v ./...