Switch from pgxn-tools #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
strategy: | |
matrix: | |
pg: [16] # [11, 12, 13, 14, 15, 16, 17] | |
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: Install Postgres ${{ matrix.pg }} | |
run: sudo ./.ci/apt-install-postgres ${{ matrix.pg }} | |
- name: Setup Rust 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: Initialize pgrx | |
run: cargo pgrx init --pg${{ matrix.pg }}="$(which pg_config)" | |
- name: Fix permissisons | |
run: chmod a+rwx "$(pg_config --pkglibdir)" "$(pg_config --sharedir)/extension" | |
- name: Run the tests | |
env: | |
RUST_BACKTRACE: 1 | |
PGUSER: postgres | |
run: cargo test --all --no-default-features --features "pg${{ matrix.pg }} pg_test" -- --nocapture |