-
-
Notifications
You must be signed in to change notification settings - Fork 58
123 lines (104 loc) · 3.99 KB
/
test_wrappers.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Test Wrappers
on:
pull_request:
push:
branches:
- main
jobs:
# =============================================================
# Native wrappers test
# =============================================================
test_native:
name: Run native wrappers tests
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build docker images
run: |
docker compose -f wrappers/.ci/docker-compose-native.yaml up -d
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
sudo apt remove -y postgres*
sudo apt-get install -y wget gnupg
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update -y -qq --fix-missing
sudo apt-get install -y \
clang-10 \
llvm-10 \
clang \
gcc \
make \
build-essential \
libz-dev \
zlib1g-dev \
strace \
libssl-dev \
pkg-config \
postgresql-15 \
postgresql-server-dev-15
sudo chmod a+rwx `/usr/lib/postgresql/15/bin/pg_config --pkglibdir` `/usr/lib/postgresql/15/bin/pg_config --sharedir`/extension /var/run/postgresql/
- run: cargo install cargo-pgrx --version 0.12.6
- run: cargo pgrx init --pg15 /usr/lib/postgresql/15/bin/pg_config
- name: Format code
run: |
cd wrappers && cargo fmt --check
- name: Run clippy
run: |
cd wrappers && RUSTFLAGS="-D warnings" cargo clippy --all --tests --no-deps --features native_fdws,helloworld_fdw
- name: Perform test
run: cd wrappers && cargo pgrx test --features "native_fdws pg15"
# =============================================================
# Wasm wrappers test
# =============================================================
test_wasm:
name: Run Wasm wrappers tests
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build docker images
run: |
docker compose -f wrappers/.ci/docker-compose-wasm.yaml up -d
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
sudo apt remove -y postgres*
sudo apt-get install -y wget gnupg
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update -y -qq --fix-missing
sudo apt-get install -y \
clang-10 \
llvm-10 \
clang \
gcc \
make \
build-essential \
libz-dev \
zlib1g-dev \
strace \
libssl-dev \
pkg-config \
postgresql-15 \
postgresql-server-dev-15
sudo chmod a+rwx `/usr/lib/postgresql/15/bin/pg_config --pkglibdir` `/usr/lib/postgresql/15/bin/pg_config --sharedir`/extension /var/run/postgresql/
- run: cargo install cargo-pgrx --version 0.12.6
- run: cargo pgrx init --pg15 /usr/lib/postgresql/15/bin/pg_config
- run: cargo install cargo-component --version 0.13.2
- run: rustup target add wasm32-unknown-unknown
- name: Build Wasm FDWs
run: |
find ./wasm-wrappers/fdw/ -name "Cargo.toml" -exec cargo component build --release --target wasm32-unknown-unknown --manifest-path {} \;
- name: Format code
run: |
find ./wasm-wrappers/fdw/ -name "Cargo.toml" -exec cargo fmt --check --manifest-path {} \;
- name: Run clippy
run: |
RUSTFLAGS="-D warnings" find ./wasm-wrappers/fdw/ -name "Cargo.toml" -exec cargo clippy --all --tests --no-deps --manifest-path {} \;
- name: Perform test
run: cd wrappers && cargo pgrx test --features "wasm_fdw pg15"