libpg_query-sys 0.4.0

FFI bindings to libpg_query
Documentation
name: Continuous integration

on: [push, pull_request]

env:
  CRATE_NAME: libpg_query-sys
  RUST_BACKTRACE: 1

jobs:
  test:
    name: Test - ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
    runs-on: ${{ matrix.platform.os }}
    strategy:
      fail-fast: false
      matrix:
        platform:
          - os_name: Linux
            os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os_name: macOS
            os: macOS-latest
            target: x86_64-apple-darwin
        toolchain:
          - stable
          - beta
          - nightly
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      # Workaround for https://github.com/actions/cache/issues/403.
      - name: Install GNU tar on macOS
        run: |
          brew install gnu-tar
          echo "PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
        if: matrix.platform.os == 'macOS-latest'
      - name: Install LLVM on Windows
        run: |
          choco install llvm
        if: matrix.platform.os == 'windows-latest'
      - name: Cache cargo & target directories
        uses: Swatinem/rust-cache@v2
      - name: Install toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.toolchain }}
      - name: Run cargo check
        run: |
          cargo check --target=${{ matrix.platform.target }}
      - name: Run cargo test
        run: |
          cargo test --target=${{ matrix.platform.target }}