Skip to content

Commit

Permalink
ci: add clippy and build
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed May 31, 2024
1 parent 09d4b67 commit 23f4ab7
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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
env:
SEMVER: "0.0.0"
VERSION: ${{ matrix.version }}
ARCH: ${{ matrix.arch }}
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 Pgrx
run: cargo install cargo-pgrx --branch v0.12.0-alpha.1-patch2 --git https://github.com/tensorchord/pgrx.git
- name: Clippy
run: cargo clippy --features "pg$VERSION"
- name: Build
run: cargo build --lib --features "pg$VERSION"

0 comments on commit 23f4ab7

Please sign in to comment.