Skip to content

feat: support DataType::List cast to json and jsonb #367

feat: support DataType::List cast to json and jsonb

feat: support DataType::List cast to json and jsonb #367

Workflow file for this run

# workflows/lint-rust.yml
#
# Lint Rust
# Lint Rust files using Clippy and Rustfmt.
name: Lint Rust
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.rs"
- "**/*.toml"
- ".github/workflows/lint-rust.yml"
workflow_dispatch:
concurrency:
group: lint-rust-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint-rust:
name: Lint Rust Files
runs-on: ubicloud-standard-2
if: github.event.pull_request.draft == false
strategy:
matrix:
pg_version: [17]
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Extract pgrx Version
id: pgrx
run: echo version=$(cargo tree --depth 1 -i pgrx -p pg_analytics | head -n 1 | cut -f2 -dv) >> $GITHUB_OUTPUT
# Caches from base branches are available to PRs, but not across unrelated branches, so we only
# save the cache on the 'dev' branch, but load it on all branches.
- name: Install Rust Cache
uses: ubicloud/rust-cache@v2
with:
prefix-key: "v1-rust"
key: ${{ matrix.pg_version }}-${{ steps.pgrx.outputs.version }}
cache-targets: true
cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }}
- name: Install & Configure Supported PostgreSQL Version
run: |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update && sudo apt-get install -y postgresql-${{ matrix.pg_version }} postgresql-server-dev-${{ matrix.pg_version }}
- name: Install pgrx
run: cargo install --locked cargo-pgrx --version ${{ steps.pgrx.outputs.version }} --debug
- name: Initialize pgrx for Current PostgreSQL Version
run: cargo pgrx init --pg${{ matrix.pg_version }}=/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config
- name: Run Rustfmt
run: cargo fmt -- --check
- name: Run Clippy
run: cargo clippy --workspace --all-targets -- -D warnings --no-deps
- name: Dependency Check
run: cargo install cargo-machete && cargo machete
- name: Install taplo
run: cargo install taplo-cli --version ^0.9 --locked --debug
- name: Run cargo-machete
run: cargo machete
# If you encounter an error, try running 'taplo format' to fix the formatting automatically.
- name: Check Cargo.toml Formatting
run: taplo format --check