chore: release pipeline #9
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: Rust | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- ".cargo/**" | |
- ".github/**" | |
- "src/**" | |
- "Cargo.lock" | |
- "Cargo.toml" | |
- "pg_bestmatch.control" | |
pull_request: | |
branches: ["main"] | |
paths: | |
- ".cargo/**" | |
- ".github/**" | |
- "src/**" | |
- "Cargo.lock" | |
- "Cargo.toml" | |
- "pg_bestmatch.control" | |
merge_group: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
SCCACHE_GHA_ENABLED: true | |
RUSTC_WRAPPER: sccache | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
check: | |
strategy: | |
matrix: | |
version: [12, 13, 14, 15, 16] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Environment | |
run: | | |
sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*' | |
sudo apt-get purge -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*' | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
- name: Set up Sccache | |
uses: mozilla-actions/[email protected] | |
- name: Set up PostgreSQL | |
run: | | |
sudo apt-get install -y postgresql-common | |
echo | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh | |
sudo apt update | |
sudo apt-get install -y postgresql-${{ matrix.version }} postgresql-server-dev-${{ matrix.version }} | |
- name: Set up Pgrx | |
run: | | |
cargo install cargo-pgrx --debug --branch v0.12.0-alpha.1-patch2 --git https://github.com/tensorchord/pgrx.git | |
cargo pgrx init --pg${{ matrix.version }}=$(which pg_config) | |
- name: Clippy | |
run: cargo clippy --lib --features "pg${{ matrix.version }}" | |
- name: Build | |
run: cargo build --lib --features "pg${{ matrix.version }}" |