-
-
Notifications
You must be signed in to change notification settings - Fork 50
110 lines (92 loc) · 3.43 KB
/
job-pg-query-extension.yml
File metadata and controls
110 lines (92 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: PG Query Extension
on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false
jobs:
build:
name: Build and Test Extension
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
php: ['8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v5
- name: Setup PHP Environment
uses: ./.github/actions/setup-php-env
with:
php-version: ${{ matrix.php }}
dependencies: locked
coverage: pcov
extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, protobuf'
tools: 'composer:v2, phpize, php-config'
- name: Install build dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libtool protobuf-compiler libprotobuf-c-dev
- name: Install build dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool protobuf protobuf-c
- name: Build libpg_query and extension
working-directory: src/extension/pg-query-ext
run: |
make clean || true
make build
- name: Run extension tests
working-directory: src/extension/pg-query-ext
run: make test
- name: Install extension
working-directory: src/extension/pg-query-ext
run: |
EXT_DIR=$(php -r 'echo ini_get("extension_dir");')
sudo cp ext/modules/pg_query.so "$EXT_DIR/"
echo "extension=pg_query.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
php -m | grep pg_query
pie-install-test:
name: Test PIE Installation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v5
- name: Setup PHP Environment
uses: ./.github/actions/setup-php-env
with:
php-version: '8.3'
dependencies: locked
extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib'
tools: 'composer:v2, phpize, php-config'
- name: Install build dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libtool protobuf-compiler libprotobuf-c-dev
- name: Install build dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool protobuf protobuf-c
- name: Install PIE
run: |
sudo curl -L -o /usr/local/bin/pie https://github.com/php/pie/releases/latest/download/pie.phar
sudo chmod +x /usr/local/bin/pie
pie --version
- name: Prepare local package for PIE installation
working-directory: src/extension/pg-query-ext
run: |
jq '. + {"version": "0.0.9999"}' composer.json > composer.tmp.json
mv composer.tmp.json composer.json
- name: Install extension via PIE (from local)
run: |
sudo pie repository:remove packagist.org
sudo pie repository:add path ${{ github.workspace }}/src/extension/pg-query-ext
sudo pie install flow-php/pg-query-ext:0.0.9999@dev
- name: Verify extension is loaded
run: |
php -m | grep pg_query