55 strategy :
66 matrix :
77 os : [ubuntu-latest, macos-latest, windows-latest]
8+ include :
9+ - os : ubuntu-latest
10+ pg-version : 15
11+ - os : macos-latest
12+ pg-version : 15
13+ - os : windows-latest
14+ pg-version : 15
815 runs-on : ${{ matrix.os }}
916 steps :
1017 - name : Check out
@@ -18,23 +25,26 @@ jobs:
1825 override : true
1926 components : rustfmt, clippy
2027
21- # OS-specific setup
2228 - name : Install dependencies (Ubuntu)
2329 if : runner.os == 'Linux'
2430 run : |
2531 sudo apt-get update
26- sudo apt-get install -y pkg-config libssl-dev postgresql-server-dev-all
32+ sudo apt-get install -y pkg-config libssl-dev
33+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
34+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
35+ sudo apt-get update
36+ sudo apt-get install -y postgresql-${{ matrix.pg-version }} postgresql-server-dev-${{ matrix.pg-version }}
2737
2838 - name : Install dependencies (macOS)
2939 if : runner.os == 'macOS'
30- run : brew install git icu4c pkg-config postgresql
40+ run : brew install git icu4c pkg-config postgresql@${{ matrix.pg-version }}
3141
3242 - name : Install PostgreSQL (Windows)
3343 if : runner.os == 'Windows'
3444 run : |
35- choco install postgresql --params '/Password:postgres' -y
36- echo "C:\Program Files\PostgreSQL\latest \bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
37- echo "C:\Program Files\PostgreSQL\latest \lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
45+ choco install postgresql${{ matrix.pg-version }} --params '/Password:postgres' -y
46+ echo "C:\Program Files\PostgreSQL\${{ matrix.pg-version }} \bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
47+ echo "C:\Program Files\PostgreSQL\${{ matrix.pg-version }} \lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
3848
3949 - name : Cache Rust dependencies
4050 uses : actions/cache@v3
@@ -51,17 +61,17 @@ jobs:
5161 uses : actions/cache@v3
5262 with :
5363 path : ~/.pgrx
54- key : ${{ runner.os }}-pgrx-${{ hashFiles('**/Cargo.lock') }}
64+ key : ${{ runner.os }}-pgrx-pg${{ matrix.pg-version }}- ${{ hashFiles('**/Cargo.lock') }}
5565 restore-keys : |
56- ${{ runner.os }}-pgrx-
66+ ${{ runner.os }}-pgrx-pg${{ matrix.pg-version }}-
5767
5868 - name : Install pgrx
5969 run : |
6070 cargo install --locked cargo-pgrx --version 0.13.1 || true
61- cargo pgrx init
71+ cargo pgrx init --pg${{ matrix.pg-version }}
6272 env :
6373 CARGO_HTTP_TIMEOUT : 300
64- PKG_CONFIG_PATH : ${{ runner.os == 'macOS' && '/opt/homebrew/opt/icu4c/lib/pkgconfig' || '' }}
74+ PKG_CONFIG_PATH : ${{ runner.os == 'macOS' && '/opt/homebrew/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/postgresql@15/lib/pkgconfig ' || '' }}
6575
6676 - name : Lint
6777 run : |
@@ -71,35 +81,32 @@ jobs:
7181 - name : Build Extension (Windows)
7282 if : runner.os == 'Windows'
7383 run : |
74- cargo pgrx package --target x86_64-pc-windows-msvc
84+ cargo pgrx package --pg-config "C:\Program Files\PostgreSQL\${{ matrix.pg-version }}\bin\pg_config.exe" -- target x86_64-pc-windows-msvc
7585
7686 - name : Build Extension (Other OS)
7787 if : runner.os != 'Windows'
78- run : cargo pgrx package
88+ run : cargo pgrx package --pg-config $(which pg_config)
7989
8090 - name : Upload Extension Artifact (Linux)
8191 if : runner.os == 'Linux'
8292 uses : actions/upload-artifact@v4
8393 with :
8494 name : pg_sqids-${{ runner.os }}
85- path : |
86- target/release/pg_sqids-pg*/lib/pg_sqids.so
95+ path : target/release/pg_sqids-pg${{ matrix.pg-version }}/lib/pg_sqids.so
8796
8897 - name : Upload Extension Artifact (macOS)
8998 if : runner.os == 'macOS'
9099 uses : actions/upload-artifact@v4
91100 with :
92101 name : pg_sqids-${{ runner.os }}
93- path : |
94- target/release/pg_sqids-pg*/lib/pg_sqids.dylib
102+ path : target/release/pg_sqids-pg${{ matrix.pg-version }}/lib/pg_sqids.dylib
95103
96104 - name : Upload Extension Artifact (Windows)
97105 if : runner.os == 'Windows'
98106 uses : actions/upload-artifact@v4
99107 with :
100108 name : pg_sqids-${{ runner.os }}
101- path : |
102- target/release/pg_sqids-pg*/lib/pg_sqids.dll
109+ path : target/release/pg_sqids-pg${{ matrix.pg-version }}/lib/pg_sqids.dll
103110
104111 - name : Test
105112 run : cargo test --all
0 commit comments