From f981e5f0893be5e8afed4af7cf06b890f469ec41 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 14:21:23 +0800 Subject: [PATCH 01/18] Pin Go 1.24.5 and merge coverage --- .github/workflows/tests.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d7988ca..0fa166a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,8 @@ jobs: if: github.event.pull_request.draft == false || (github.event.action == 'labeled' && github.event.label.name == 'testing') runs-on: ubuntu-latest strategy: - matrix: - go-version: [1.24.x] + matrix: + go-version: ['1.24.5'] steps: - uses: actions/setup-go@v5 with: @@ -29,20 +29,29 @@ jobs: - name: Run pkg tests run: | - go test ./pkg/... -coverprofile=coverage.out - go tool cover -func=coverage.out | tail -n 1 + go test ./pkg/... -coverprofile=coverage-pkg.out + go tool cover -func=coverage-pkg.out | tail -n 1 - name: Run boost & env tests run: | - go test ./boost ./env -coverprofile=coverage.out - go tool cover -func=coverage.out | tail -n 1 + go test ./boost ./env -coverprofile=coverage-boost-env.out + go tool cover -func=coverage-boost-env.out | tail -n 1 - name: Run handlers tests run: | - go test ./handler/... -coverprofile=coverage.out - go tool cover -func=coverage.out | tail -n 1 + go test ./handler/... -coverprofile=coverage-handler.out + go tool cover -func=coverage-handler.out | tail -n 1 - name: Run database tests run: | - go test ./database/... -coverprofile=coverage.out - go tool cover -func=coverage.out | tail -n 1 + go test ./database/... -coverprofile=coverage-database.out + go tool cover -func=coverage-database.out | tail -n 1 + + - name: Merge coverage reports + run: go tool cover -merge=coverage-*.out -o coverage.out + + - name: Upload coverage artifact + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: coverage.out From bcbe80f66d0cd752c3573f9a9da224122fde0f8d Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 14:30:17 +0800 Subject: [PATCH 02/18] test: expand isValidTable edge cases --- database/model_internal_test.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/database/model_internal_test.go b/database/model_internal_test.go index 2fabf46b..728cb714 100644 --- a/database/model_internal_test.go +++ b/database/model_internal_test.go @@ -1,6 +1,9 @@ package database -import "testing" +import ( + "strings" + "testing" +) func TestIsValidTable(t *testing.T) { if !isValidTable("users") { @@ -10,3 +13,22 @@ func TestIsValidTable(t *testing.T) { t.Fatalf("unexpected valid table") } } + +func TestIsValidTableEdgeCases(t *testing.T) { + invalid := []string{ + "", + "user!@#", + "user-name", + "Users", + "USERS", + "table123", + strings.Repeat("x", 256), + " ", + } + + for _, name := range invalid { + if isValidTable(name) { + t.Fatalf("%q should be invalid", name) + } + } +} From 61f346ee4253e42ec02123b3bb073a1405df2716 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 14:34:55 +0800 Subject: [PATCH 03/18] use artifact action v4 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0fa166a4..4e14c078 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: run: go tool cover -merge=coverage-*.out -o coverage.out - name: Upload coverage artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage.out From 9321c8129d6a4f4e76a812aebbcfcf5e9dcd75f4 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 14:42:07 +0800 Subject: [PATCH 04/18] fix coverage merging --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e14c078..fb581821 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,22 +29,22 @@ jobs: - name: Run pkg tests run: | - go test ./pkg/... -coverprofile=coverage-pkg.out + go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg.out go tool cover -func=coverage-pkg.out | tail -n 1 - name: Run boost & env tests run: | - go test ./boost ./env -coverprofile=coverage-boost-env.out + go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env.out go tool cover -func=coverage-boost-env.out | tail -n 1 - name: Run handlers tests run: | - go test ./handler/... -coverprofile=coverage-handler.out + go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler.out go tool cover -func=coverage-handler.out | tail -n 1 - name: Run database tests run: | - go test ./database/... -coverprofile=coverage-database.out + go test -coverpkg=./... ./database/... -coverprofile=coverage-database.out go tool cover -func=coverage-database.out | tail -n 1 - name: Merge coverage reports From 01972f99e134170b8285049a3bbb06c166d437b7 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 14:53:16 +0800 Subject: [PATCH 05/18] Fix coverage merge step --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb581821..bdf9e927 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,9 @@ jobs: go tool cover -func=coverage-database.out | tail -n 1 - name: Merge coverage reports - run: go tool cover -merge=coverage-*.out -o coverage.out + run: | + echo "mode: set" > coverage.out + tail -q -n +2 coverage-*.out >> coverage.out - name: Upload coverage artifact uses: actions/upload-artifact@v4 From 36c44373c776bcb7d251c658897239fbd850a6ad Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 15:08:21 +0800 Subject: [PATCH 06/18] test: run workflow across go versions and print merged coverage --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bdf9e927..9cbec10f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24.5'] + go-version: ['1.24.4', '1.23.3'] steps: - uses: actions/setup-go@v5 with: @@ -51,6 +51,7 @@ jobs: run: | echo "mode: set" > coverage.out tail -q -n +2 coverage-*.out >> coverage.out + go tool cover -func=coverage.out | tail -n 1 - name: Upload coverage artifact uses: actions/upload-artifact@v4 From 59ecb428e9cfca9f32e5029307a8c4cc407bd847 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 15:15:44 +0800 Subject: [PATCH 07/18] Pin Go versions to 1.24.5 and 1.23.4 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9cbec10f..eb8b7166 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24.4', '1.23.3'] + go-version: ['1.24.5', '1.23.4'] steps: - uses: actions/setup-go@v5 with: From 11bd9d80a309cf9389bb01cc12e7563b277506ac Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 15:20:26 +0800 Subject: [PATCH 08/18] Remove coverage artifact upload --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb8b7166..8401d673 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,8 +53,3 @@ jobs: tail -q -n +2 coverage-*.out >> coverage.out go tool cover -func=coverage.out | tail -n 1 - - name: Upload coverage artifact - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: coverage.out From 3a96675518aff20e5c8d69e7da1fe7ea218909a5 Mon Sep 17 00:00:00 2001 From: Gus Date: Fri, 1 Aug 2025 15:31:32 +0800 Subject: [PATCH 09/18] Test on Go 1.24.5 and 1.24.4 --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8401d673..d4c1400b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24.5', '1.23.4'] + go-version: ['1.24.5', '1.24.4'] + max-parallel: 1 steps: - uses: actions/setup-go@v5 with: From 6ed39712a66d15a548cf146ddcbe762cdd6f98c4 Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 15:45:56 +0800 Subject: [PATCH 10/18] add version --- .github/workflows/tests.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4c1400b..4019c39c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,9 +9,8 @@ jobs: if: github.event.pull_request.draft == false || (github.event.action == 'labeled' && github.event.label.name == 'testing') runs-on: ubuntu-latest strategy: - matrix: - go-version: ['1.24.5', '1.24.4'] - max-parallel: 1 + matrix: + go-version: ['1.24.5', '1.24.4'] steps: - uses: actions/setup-go@v5 with: @@ -30,27 +29,26 @@ jobs: - name: Run pkg tests run: | - go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg.out - go tool cover -func=coverage-pkg.out | tail -n 1 + go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg-${{ matrix.go-version }}.out + go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out | tail -n 1 - name: Run boost & env tests run: | - go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env.out - go tool cover -func=coverage-boost-env.out | tail -n 1 + go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out + go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out | tail -n 1 - name: Run handlers tests run: | - go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler.out - go tool cover -func=coverage-handler.out | tail -n 1 + go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler-${{ matrix.go-version }}.out + go tool cover -func=coverage-handler-${{ matrix.go-version }}.out | tail -n 1 - name: Run database tests run: | - go test -coverpkg=./... ./database/... -coverprofile=coverage-database.out - go tool cover -func=coverage-database.out | tail -n 1 + go test -coverpkg=./... ./database/... -coverprofile=coverage-database-${{ matrix.go-version }}.out + go tool cover -func=coverage-database-${{ matrix.go-version }}.out | tail -n 1 - name: Merge coverage reports run: | - echo "mode: set" > coverage.out - tail -q -n +2 coverage-*.out >> coverage.out - go tool cover -func=coverage.out | tail -n 1 - + echo "mode: set" > coverage-${{ matrix.go-version }}.out + tail -q -n +2 coverage-*-*.out >> coverage-${{ matrix.go-version }}.out + go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 From c49b7d67124179f20710034ef8ca9a72680c0fba Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 15:50:27 +0800 Subject: [PATCH 11/18] cache --- .github/workflows/tests.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4019c39c..d1129603 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,14 +18,18 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - name: Cache Go modules + uses: actions/cache@v4 with: path: | ~/go/pkg/mod ~/.cache/go-build - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go- + ${{ runner.os }}-go-${{ matrix.go-version }}- + + - name: Download Go modules + run: go mod download - name: Run pkg tests run: | @@ -50,5 +54,5 @@ jobs: - name: Merge coverage reports run: | echo "mode: set" > coverage-${{ matrix.go-version }}.out - tail -q -n +2 coverage-*-*.out >> coverage-${{ matrix.go-version }}.out + tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 From ef13b0be3602321bafa339de52fbd6d1502b773e Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 15:56:10 +0800 Subject: [PATCH 12/18] go.sum --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d1129603..49b1b6d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: path: | ~/go/pkg/mod ~/.cache/go-build - key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} restore-keys: | ${{ runner.os }}-go-${{ matrix.go-version }}- From 00a0b60aeb4a7a9665555c1573f6aa05f1442c49 Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:04:34 +0800 Subject: [PATCH 13/18] wip --- .github/workflows/tests.yml | 45 ++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 49b1b6d6..fb92311b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,11 +6,13 @@ on: jobs: test: - if: github.event.pull_request.draft == false || (github.event.action == 'labeled' && github.event.label.name == 'testing') + if: github.event.pull_request.draft == false || + (github.event.action == 'labeled' && github.event.label.name == 'testing') runs-on: ubuntu-latest strategy: matrix: go-version: ['1.24.5', '1.24.4'] + steps: - uses: actions/setup-go@v5 with: @@ -18,6 +20,16 @@ jobs: - uses: actions/checkout@v4 + # ——— DEBUG: confirm go.sum is where we expect ——— + - name: Verify go.sum presence + run: | + echo "Workspace: $PWD" + ls -lah . + if [[ ! -f go.sum ]]; then + echo "::error ::go.sum not found in workspace root!" + exit 1 + fi + - name: Cache Go modules uses: actions/cache@v4 with: @@ -27,32 +39,43 @@ jobs: key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} restore-keys: | ${{ runner.os }}-go-${{ matrix.go-version }}- + cache-dependency-path: go.sum - name: Download Go modules run: go mod download - name: Run pkg tests run: | - go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg-${{ matrix.go-version }}.out - go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out | tail -n 1 + go test -coverpkg=./... ./pkg/... \ + -coverprofile=coverage-pkg-${{ matrix.go-version }}.out + go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out \ + | tail -n 1 - name: Run boost & env tests run: | - go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out - go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out | tail -n 1 + go test -coverpkg=./... ./boost ./env \ + -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out + go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out \ + | tail -n 1 - name: Run handlers tests run: | - go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler-${{ matrix.go-version }}.out - go tool cover -func=coverage-handler-${{ matrix.go-version }}.out | tail -n 1 + go test -coverpkg=./... ./handler/... \ + -coverprofile=coverage-handler-${{ matrix.go-version }}.out + go tool cover -func=coverage-handler-${{ matrix.go-version }}.out \ + | tail -n 1 - name: Run database tests run: | - go test -coverpkg=./... ./database/... -coverprofile=coverage-database-${{ matrix.go-version }}.out - go tool cover -func=coverage-database-${{ matrix.go-version }}.out | tail -n 1 + go test -coverpkg=./... ./database/... \ + -coverprofile=coverage-database-${{ matrix.go-version }}.out + go tool cover -func=coverage-database-${{ matrix.go-version }}.out \ + | tail -n 1 - name: Merge coverage reports run: | echo "mode: set" > coverage-${{ matrix.go-version }}.out - tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out - go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 + tail -q -n +2 coverage-*-${{ matrix.go-version }}.out \ + >> coverage-${{ matrix.go-version }}.out + go tool cover -func=coverage-${{ matrix.go-version }}.out \ + | tail -n 1 From 848abf7303d4fa9a21af81c04d78ab227a74ce6d Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:07:24 +0800 Subject: [PATCH 14/18] wip --- .github/workflows/tests.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb92311b..55c1c009 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,16 +20,6 @@ jobs: - uses: actions/checkout@v4 - # ——— DEBUG: confirm go.sum is where we expect ——— - - name: Verify go.sum presence - run: | - echo "Workspace: $PWD" - ls -lah . - if [[ ! -f go.sum ]]; then - echo "::error ::go.sum not found in workspace root!" - exit 1 - fi - - name: Cache Go modules uses: actions/cache@v4 with: @@ -39,7 +29,6 @@ jobs: key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} restore-keys: | ${{ runner.os }}-go-${{ matrix.go-version }}- - cache-dependency-path: go.sum - name: Download Go modules run: go mod download From 3dd2c9318e86fdd85e3c15f6a3d20eb740b8c245 Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:10:49 +0800 Subject: [PATCH 15/18] wip --- .github/workflows/tests.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55c1c009..938b85bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,19 +17,10 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + cache: 'go-mod' - uses: actions/checkout@v4 - - name: Cache Go modules - uses: actions/cache@v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.go-version }}- - - name: Download Go modules run: go mod download From 59ac84f9829eccf87795b956be0b051a5839b7b4 Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:19:39 +0800 Subject: [PATCH 16/18] wip --- .github/workflows/tests.yml | 52 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 938b85bb..9f81a1a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,8 +6,7 @@ on: jobs: test: - if: github.event.pull_request.draft == false || - (github.event.action == 'labeled' && github.event.label.name == 'testing') + if: github.event.pull_request.draft == false || (github.event.action == 'labeled' && github.event.label.name == 'testing') runs-on: ubuntu-latest strategy: matrix: @@ -17,45 +16,50 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - cache: 'go-mod' - uses: actions/checkout@v4 + - name: Debug repository files + run: | + echo "Workspace $PWD" + ls -lah . + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: + - ~/go/pkg/mod + - ~/.cache/go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} + restore-keys: + - ${{ runner.os }}-go-${{ matrix.go-version }}- + - name: Download Go modules - run: go mod download + run: | + go mod download - name: Run pkg tests run: | - go test -coverpkg=./... ./pkg/... \ - -coverprofile=coverage-pkg-${{ matrix.go-version }}.out - go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out \ - | tail -n 1 + go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg-${{ matrix.go-version }}.out + && go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out | tail -n 1 - name: Run boost & env tests run: | - go test -coverpkg=./... ./boost ./env \ - -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out - go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out \ - | tail -n 1 + go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out + && go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out | tail -n 1 - name: Run handlers tests run: | - go test -coverpkg=./... ./handler/... \ - -coverprofile=coverage-handler-${{ matrix.go-version }}.out - go tool cover -func=coverage-handler-${{ matrix.go-version }}.out \ - | tail -n 1 + go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler-${{ matrix.go-version }}.out + && go tool cover -func=coverage-handler-${{ matrix.go-version }}.out | tail -n 1 - name: Run database tests run: | - go test -coverpkg=./... ./database/... \ - -coverprofile=coverage-database-${{ matrix.go-version }}.out - go tool cover -func=coverage-database-${{ matrix.go-version }}.out \ - | tail -n 1 + go test -coverpkg=./... ./database/... -coverprofile=coverage-database-${{ matrix.go-version }}.out + && go tool cover -func=coverage-database-${{ matrix.go-version }}.out | tail -n 1 - name: Merge coverage reports run: | echo "mode: set" > coverage-${{ matrix.go-version }}.out - tail -q -n +2 coverage-*-${{ matrix.go-version }}.out \ - >> coverage-${{ matrix.go-version }}.out - go tool cover -func=coverage-${{ matrix.go-version }}.out \ - | tail -n 1 + && tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out + && go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 From 459e8efc819d6c2fc2a67ae65b79caaa4c08d360 Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:23:46 +0800 Subject: [PATCH 17/18] wip --- .github/workflows/tests.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f81a1a1..19790b5b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,8 @@ on: jobs: test: - if: github.event.pull_request.draft == false || (github.event.action == 'labeled' && github.event.label.name == 'testing') + if: github.event.pull_request.draft == false || + (github.event.action == 'labeled' && github.event.label.name == 'testing') runs-on: ubuntu-latest strategy: matrix: @@ -27,39 +28,38 @@ jobs: - name: Cache Go modules uses: actions/cache@v4 with: - path: - - ~/go/pkg/mod - - ~/.cache/go-build + path: | + ~/go/pkg/mod + ~/.cache/go-build key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.sum') }} - restore-keys: - - ${{ runner.os }}-go-${{ matrix.go-version }}- + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- - name: Download Go modules - run: | - go mod download + run: go mod download - name: Run pkg tests run: | go test -coverpkg=./... ./pkg/... -coverprofile=coverage-pkg-${{ matrix.go-version }}.out - && go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out | tail -n 1 + go tool cover -func=coverage-pkg-${{ matrix.go-version }}.out | tail -n 1 - name: Run boost & env tests run: | go test -coverpkg=./... ./boost ./env -coverprofile=coverage-boost-env-${{ matrix.go-version }}.out - && go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out | tail -n 1 + go tool cover -func=coverage-boost-env-${{ matrix.go-version }}.out | tail -n 1 - name: Run handlers tests run: | go test -coverpkg=./... ./handler/... -coverprofile=coverage-handler-${{ matrix.go-version }}.out - && go tool cover -func=coverage-handler-${{ matrix.go-version }}.out | tail -n 1 + go tool cover -func=coverage-handler-${{ matrix.go-version }}.out | tail -n 1 - name: Run database tests run: | go test -coverpkg=./... ./database/... -coverprofile=coverage-database-${{ matrix.go-version }}.out - && go tool cover -func=coverage-database-${{ matrix.go-version }}.out | tail -n 1 + go tool cover -func=coverage-database-${{ matrix.go-version }}.out | tail -n 1 - name: Merge coverage reports run: | echo "mode: set" > coverage-${{ matrix.go-version }}.out - && tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out - && go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 + tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out + go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1 From 16ef98c1339481f584510d6ca8553e301b8163db Mon Sep 17 00:00:00 2001 From: Gustavo Ocanto Date: Fri, 1 Aug 2025 16:28:29 +0800 Subject: [PATCH 18/18] wip --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 19790b5b..380e5c97 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,11 +20,6 @@ jobs: - uses: actions/checkout@v4 - - name: Debug repository files - run: | - echo "Workspace $PWD" - ls -lah . - - name: Cache Go modules uses: actions/cache@v4 with: