-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.48 KB
/
lint-and-test.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
name: 🧪 Lint and Test
on:
push:
branches-ignore: [wip/**]
jobs:
lint:
name: 🔎 Lint and Cover
runs-on: ubuntu-latest
env: { PGVERSION: 16 }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with: { components: "rustfmt, clippy" }
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Postgres
run: sudo ./.ci/apt-install-postgres ${{ env.PGVERSION }}
- name: Install pgrx
run: cargo install cargo-pgrx --locked --version "$(make pgrx-version)"
- name: Initialize pgrx
run: cargo pgrx init --pg${{ env.PGVERSION }}="$(which pg_config)"
- name: Cargo format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --features pg${{ env.PGVERSION }} --no-default-features
- name: Generate Coverage
env: { RUST_BACKTRACE: 1, PGUSER: postgres }
run: make cover
- name: Publish Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: tembo-io/pg-jsonschema
files: target/cover/cobertura.xml
- name: Remove Data Diretory
run: rm -rf target/pgrx-test-${{ env.PGVERSION }}
test:
runs-on: ubuntu-latest
strategy:
matrix:
pg: [11, 12, 13, 14, 15, 16]
os: [[🐧, Ubuntu]] # [🍎, macOS], [🪟, Windows]]
name: 🐘 Postgres ${{ matrix.pg }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Postgres ${{ matrix.pg }}
run: sudo ./.ci/apt-install-postgres ${{ matrix.pg }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Remove Data Diretory
run: rm -rf target/pgrx-test-${{ matrix.pg }}
- name: Install pgrx
run: cargo install cargo-pgrx --locked --version "$(make pgrx-version)"
- name: Initialize pgrx
run: cargo pgrx init --pg${{ matrix.pg }}="$(which pg_config)"
- run: ls -lah target/ && ls -lah target/pgrx-test-${{ matrix.pg }}
- name: Run the tests
env: { RUST_BACKTRACE: 1, PGUSER: postgres }
run: cargo test --all --no-default-features --features "pg${{ matrix.pg }} pg_test" -- --nocapture
- name: Remove Data Diretory
run: rm -rf target/pgrx-test-${{ matrix.pg }}