Skip to content

Commit

Permalink
Start lint and test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 3, 2024
1 parent 2c5dc9d commit 7ddf372
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: πŸ§ͺ Lint and Test

on:
push:
branches-ignore: [wip/**]

jobs:
lint:
name: πŸ”Ž Lint Code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with: { cache-directories: /home/runner/.pgrx }
- name: Install pgrx
run: cargo install --locked cargo-pgrx --force
- name: Cargo format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy

test:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
strategy:
fail-fast: false
matrix:
pg: [11, 12, 13, 14, 15, 16]
os: [[🐧, Ubuntu]] # , [🍎, macOS], [πŸͺŸ, Windows]]
name: 🐘 Postgres ${{ matrix.pg }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
steps:
- uses: actions/checkout@v2
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Start Postgres ${{ matrix.pg }}
run: pg-start ${{ matrix.pg }}
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with: { cache-directories: /home/runner/.pgrx }
- name: Install pgrx
run: cargo install cargo-pgrx --version "$(perl -ne 'print $1 if /^pgrx\s+=\s"=?([^"]+)/' Cargo.toml)" --locked
- name: Initiazlie pgrx
run: cargo pgrx init --pg${{ matrix.pg }}="$(which pg_config)"
- name: Run the tests
run: RUST_BACKTRACE=1 cargo test --all --no-default-features --features "pg${{ matrix.pg }} pg_test" -- --nocapture

0 comments on commit 7ddf372

Please sign in to comment.