Skip to content

Commit ccce801

Browse files
committed
feat: build in ci as well
1 parent d0612e4 commit ccce801

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ jobs:
112112
- name: Run tests
113113
run: echo "\q" | cargo pgrx run pg${{ matrix.pg }} && cargo test --no-default-features --features pg${{ matrix.pg }}
114114

115+
- name: Build
116+
run: cargo pgrx package --features pg${{ matrix.pg }} --pg-config /usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config
117+
118+
- name: Archive production artifacts
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: typeid-${{matrix.pg}}
122+
path: |
123+
target/release/typeid-pg${{ matrix.pg }}
115124
# Attempt to make the cache payload slightly smaller.
116125
- name: Clean up built PGRX files
117126
run: |

.github/workflows/clippy.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,33 @@ jobs:
4141
toolchain: stable
4242
components: clippy
4343
override: true
44-
44+
45+
- name: Install release version of PostgreSQL
46+
run: |
47+
echo "----- Set up PostgreSQL Apt repository -----"
48+
sudo apt-get install -y wget gnupg
49+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
50+
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
51+
sudo apt-get update -y -qq --fix-missing
52+
echo ""
53+
54+
sudo apt-get install -y \
55+
postgresql-${{ matrix.pg }} \
56+
postgresql-server-dev-${{ matrix.pg }}
57+
58+
echo ""
59+
echo "----- pg_config -----"
60+
pg_config
61+
echo ""
62+
63+
- name: Set up PostgreSQL permissions
64+
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/
4565

4666
- name: Install cargo-pgrx
4767
run: |
4868
PGRX_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name=="pgrx")|.version')
4969
cargo install --locked --version=$PGRX_VERSION cargo-pgrx --debug --force
50-
cargo pgrx init --pg${{ matrix.pg }} download
70+
cargo pgrx init --pg${{ matrix.pg }} /usr/lib/postgresql/${{ matrix.pg }}/bin/pg_config
5171
5272
- name: Install required cargo
5373
run: cargo install clippy-sarif sarif-fmt
@@ -60,7 +80,7 @@ jobs:
6080
continue-on-error: true
6181

6282
- name: Upload analysis results to GitHub
63-
uses: github/codeql-action/upload-sarif@v2
83+
uses: github/codeql-action/upload-sarif@v3
6484
with:
6585
sarif_file: rust-clippy-results.sarif
6686
wait-for-processing: true

0 commit comments

Comments
 (0)