forked from postgresml/postgresml
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.1 KB
/
ci.tgmc.yml
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
name: tests (tgmc)
on:
push:
branches:
- tgmc-master
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: pgml-extension
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Changed files in pgml-extension
id: pgml_extension_changed
run: |
echo "PGML_EXTENSION_CHANGED_FILES=$(git diff --name-only HEAD HEAD~1 . | wc -l)" >> $GITHUB_OUTPUT
- name: Install dependencies
if: steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
run: |
sudo apt-get update && \
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt-get install -y \
curl \
build-essential \
libopenblas-dev \
clang \
python3-dev \
libpython3-dev \
postgresql \
postgresql-server-dev-14 \
pkg-config \
python3-pip \
python3 \
lld
sudo pip3 install -r requirements.linux.txt
- name: Cache dependencies
uses: actions/cache@v3
if: steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
with:
path: |
~/.cargo
pgml-extension/target
~/.pgrx
key: ${{ runner.os }}-rust-1.74-${{ hashFiles('pgml-extension/Cargo.lock') }}
- name: Submodules
if: steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
run: |
git submodule update --init --recursive
- name: Run tests
if: steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source ~/.cargo/env
cargo install cargo-pgrx --version "0.11.2" --locked
if [[ ! -d ~/.pgrx ]]; then
cargo pgrx init
fi
cargo pgrx test
# cargo pgrx start
# psql -p 28815 -h 127.0.0.1 -d pgml -P pager -f tests/test.sql
# cargo pgrx stop