-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.65 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
name: 🧪 Lint and Test
on:
push:
branches-ignore: [wip/**]
jobs:
test:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
strategy:
matrix:
pg: [12, 13, 14, 15, 16, 17]
name: 🐘 Postgres ${{ matrix.pg }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start PostgreSQL ${{ matrix.pg }}
run: pg-start ${{ matrix.pg }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Test on PostgreSQL ${{ matrix.pg }}
run: pgrx-build-test
lint:
name: ✅ Lint and Cover
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
env: { PGVERSION: 16 }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start PostgreSQL ${{ env.PGVERSION }}
run: pg-start ${{ env.PGVERSION }} libxml2-utils
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install pgrx
run: make install-pgrx
- name: Initialize pgrx
run: make pgrx-init
- name: Format and Lint
run: make lint
- name: Generate Coverage
run: make cover RUST_BACKTRACE=1 PGUSER=postgres PGDATA=/var/lib/postgresql/pgrx
- name: Publish Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: tembo-io/pg-jsonschema-boon
files: target/cover/cobertura.xml
- name: Clear Badge Cache
uses: kevincobain2000/action-camo-purge@v1
if: github.ref_name == 'main'