pg_parse 0.12.0

PostgreSQL parser that uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.
Documentation
on:
  pull_request:
    types: [ opened, synchronize, reopened ]
  push:
    branches:
      - master
      - "[0-9].x"

name: Continuous integration

jobs:
  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - beta

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: ${{ runner.os }}-${{ matrix.backend }}-cargo-${{ hashFiles('**/Cargo.toml') }}

      - name: Install toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.rust }}

      - name: Build pg_parse
        run: cargo build --all-features

      - name: Run tests
        run: cargo test --all-features

  check_style:
    name: Check file formatting and style
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable
          components: clippy, rustfmt

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }}

      - name: Check file formatting
        run: cargo fmt --all -- --check

      - name: Run clippy
        run: cargo clippy