@@ -3,10 +3,11 @@ name: CI
33on :
44 push :
55 branches :
6- - main
6+ - next
77 pull_request :
88 branches :
99 - main
10+ - next
1011
1112env :
1213 CARGO_TERM_COLOR : always
@@ -18,16 +19,42 @@ jobs:
1819 strategy :
1920 fail-fast : false # We want all of them to run, even if one fails
2021 matrix :
21- os : [ "ubuntu-latest " ]
22- pg : [ "12", " 13", "14", "15", "16" ]
22+ os : [ "buildjet-4vcpu- ubuntu-2204 " ]
23+ pg : [ "13", "14", "15", "16", "17 " ]
2324
2425 runs-on : ${{ matrix.os }}
2526 env :
2627 RUSTC_WRAPPER : sccache
2728 SCCACHE_DIR : /home/runner/.cache/sccache
2829 RUST_TOOLCHAIN : ${{ matrix.rust || 'stable' }}
30+ # Github token is there to avoid hitting the rate limits (which does happen for some reason when querying the latest release)
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2932 steps :
3033 - uses : actions/checkout@v4
34+ - name : Set up Rust
35+ uses : actions-rs/toolchain@v1
36+ with :
37+ toolchain : stable
38+ override : true
39+
40+ - name : Install PostgreSQL (Linux)
41+ if : runner.os == 'Linux'
42+ run : |
43+ sudo apt-get install -y wget gnupg
44+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
45+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
46+ sudo apt-get update -y -qq --fix-missing
47+ sudo apt-get install -y postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
48+
49+ sudo chmod a+rwx `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --pkglibdir` `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --sharedir`/extension /var/run/postgresql/
50+
51+ - name : Install PostgreSQL (macOS)
52+ if : runner.os == 'macOS'
53+ run : |
54+ brew install postgresql@${{ matrix.pg_version }}
55+ echo "/usr/local/opt/postgresql@${{ matrix.pg_version }}/bin" >> $GITHUB_PATH
56+
57+
3158 - name : Set up prerequisites and environment
3259 run : |
3360 sudo apt-get update -y -qq --fix-missing
6289 env
6390 echo ""
6491
65- - name : Install release version of PostgreSQL
66- run : |
67- echo "----- Set up PostgreSQL Apt repository -----"
68- sudo apt-get install -y wget gnupg
69- sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
70- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
71- sudo apt-get update -y -qq --fix-missing
72- echo ""
73-
74- sudo apt-get install -y \
75- postgresql-${{ matrix.pg }} \
76- postgresql-server-dev-${{ matrix.pg }}
77-
78- echo ""
79- echo "----- pg_config -----"
80- pg_config
81- echo ""
82- - name : Set up PostgreSQL permissions
83- run : sudo chmod a+rwx `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --pkglibdir` `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --sharedir`/extension /var/run/postgresql/
84-
8592 - name : Cache cargo registry
8693 uses : actions/cache@v4
8794 continue-on-error : false
@@ -139,17 +146,41 @@ jobs:
139146 run : sccache --stop-server || true
140147 Install :
141148 runs-on : ubuntu-latest
149+ strategy :
150+ matrix :
151+ os : [ "buildjet-4vcpu-ubuntu-2204" ]
152+ pg : [ "16" ]
142153 steps :
143154 - uses : actions/checkout@v4
144- - name : Install PostgreSQL headers
155+
156+ - name : Set up Rust
157+ uses : actions-rs/toolchain@v1
158+ with :
159+ toolchain : stable
160+ override : true
161+
162+ - name : Install PostgreSQL (Linux)
163+ if : runner.os == 'Linux'
145164 run : |
146- sudo apt-get update
147- sudo apt-get install postgresql-server-dev-14
165+ sudo apt-get install -y wget gnupg
166+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
167+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
168+ sudo apt-get update -y -qq --fix-missing
169+ sudo apt-get install -y postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
170+
171+ sudo chmod a+rwx `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --pkglibdir` `/usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config --sharedir`/extension /var/run/postgresql/
172+
173+ - name : Install PostgreSQL (macOS)
174+ if : runner.os == 'macOS'
175+ run : |
176+ brew install postgresql@${{ matrix.pg }}
177+ echo "/usr/local/opt/postgresql@${{ matrix.pg }}/bin" >> $GITHUB_PATH
178+
148179 - name : Install cargo-pgrx
149180 run : |
150181 PGRX_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name=="pgrx")|.version')
151182 cargo install --locked --version=$PGRX_VERSION cargo-pgrx --debug --force
152- cargo pgrx init --pg14 $(which pg_config)
183+ cargo pgrx init --pg${{ matrix.pg }} $(which pg_config)
153184 - name : Install TypeID/pgrx
154185 run : |
155186 cargo pgrx install --no-default-features --release --sudo
0 commit comments