Skip to content

Commit

Permalink
Use pgxn-tools for lint and cover too
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 23, 2024
1 parent 31cdb99 commit e6a83dd
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,35 @@ on:
branches-ignore: [wip/**]

jobs:
test:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
strategy:
matrix:
pg: [11, 12, 13, 14, 15, 16]
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: 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: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with: { components: "rustfmt, clippy" }
- name: Start PostgreSQL ${{ matrix.pg }}
run: pg-start ${{ matrix.pg }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Postgres
run: sudo ./.ci/apt-install-postgres ${{ env.PGVERSION }}
- name: Install pgrx
run: make install-pgrx
- name: Initialize pgrx
run: make pgrx-init
- name: Format and Lint
Expand All @@ -33,22 +46,3 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
slug: tembo-io/pg-jsonschema-boon
files: target/cover/cobertura.xml
- name: Remove Data Diretory
run: rm -rf target/pgrx-test-data-${{ env.PGVERSION }}

test:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
strategy:
matrix:
pg: [11, 12, 13, 14, 15, 16]
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: Test on PostgreSQL ${{ matrix.pg }}
run: pgrx-build-test

0 comments on commit e6a83dd

Please sign in to comment.