Skip to content

Commit d3a51cd

Browse files
committed
fix: run extension tests after building the extension to handle code coverage
1 parent e7cb1f8 commit d3a51cd

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

.github/workflows/job-pg-query-extension.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: PG Query Extension
22

33
on:
44
workflow_call:
5+
secrets:
6+
CODECOV_TOKEN:
7+
required: false
58

69
jobs:
710
build:
@@ -16,12 +19,14 @@ jobs:
1619
steps:
1720
- uses: actions/checkout@v5
1821

19-
- name: Setup PHP
20-
uses: shivammathur/setup-php@v2
22+
- name: Setup PHP Environment
23+
uses: ./.github/actions/setup-php-env
2124
with:
2225
php-version: ${{ matrix.php }}
23-
tools: phpize, php-config
24-
extensions: json
26+
dependencies: locked
27+
coverage: pcov
28+
extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, protobuf'
29+
tools: 'composer:v2, phpize, php-config'
2530

2631
- name: Install build dependencies (Linux)
2732
if: runner.os == 'Linux'
@@ -43,3 +48,20 @@ jobs:
4348
- name: Run extension tests
4449
working-directory: src/extension/pg-query-ext
4550
run: make test
51+
52+
- name: Install extension
53+
working-directory: src/extension/pg-query-ext
54+
run: |
55+
sudo make install
56+
php -m | grep pg_query
57+
58+
- name: Run pg-query library tests
59+
run: composer test:lib:pg-query
60+
61+
- name: Upload to Codecov
62+
if: ${{ matrix.os == 'ubuntu-latest' }}
63+
uses: ./.github/actions/codecov-report
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
php-version: ${{ matrix.php }}
67+
dependencies: locked

.github/workflows/test-suite.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
extension-tests:
4646
uses: ./.github/workflows/job-extension-tests.yml
4747

48+
pg-query-extension:
49+
uses: ./.github/workflows/job-pg-query-extension.yml
50+
secrets: inherit
51+
4852
windows-tests:
4953
uses: ./.github/workflows/job-windows-tests.yml
5054

0 commit comments

Comments
 (0)