This repository was archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (54 loc) · 1.98 KB
/
ci.yaml
File metadata and controls
63 lines (54 loc) · 1.98 KB
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
name: ci
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
postgres:
- version: "15"
- version: "14"
- version: "13"
- version: "12"
env:
RUSTC_WRAPPER: sccache
SCCACHE_BUCKET: promscale-extension-sccache
AWS_ACCESS_KEY_ID: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: dtolnay/rust-toolchain@1.64.0
- name: Setup sccache
run: |
curl -L "https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz" | tar zxf -
chmod +x sccache-*/sccache
sudo mv sccache-*/sccache /usr/local/bin/sccache
sccache --show-stats
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.postgres.version }}
- name: Install cargo-pgx
run: |
./install-cargo-pgx.sh
- name: Cache pgx
id: cache-pgx
uses: actions/cache@v3
with:
path: ~/.pgx
key: dot-pgx-${{ matrix.postgres.version }}-cargo-${{ hashFiles('**/Cargo.*') }}
- name: Initialize pgx
if: ${{ steps.cache-pgx.outputs.cache-hit != 'true' }}
run: cargo pgx init --pg${{ matrix.postgres.version }} download
- name: Run cargo test
run: cargo pgx test pg${{ matrix.postgres.version }}
# Note: pgx puts the postgres test configuration data in target/pgx-test-data-<pg_ver>
# Swatinem/rust-cache "cleans" and then caches this directory. This
# "cleaning" breaks pgx when the cache is restored. By removing the
# directory, we prevent it from being incorrectly cached.
- name: Remove pgx-test-data directory
run: |
rm -rf target/pgx-test-data*
- name: Show sccache stats
run: sccache --show-stats