Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[profile.default]
slow-timeout = { period = "10s", terminate-after = 6, grace-period = "0s" }
status-level = "fail"
final-status-level = "fail"
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Bug report
description: Report incorrect behavior in pglite-oxide.
title: "bug: "
labels: ["bug"]
body:
- type: textarea
id: summary
attributes:
label: Summary
description: What happened, and what did you expect?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduction
description: Minimal Rust code or commands that reproduce the issue.
render: rust
validations:
required: true
- type: input
id: versions
attributes:
label: Versions
description: pglite-oxide, Rust, OS, and architecture.
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Feature request
description: Suggest a focused API, runtime, or packaging improvement.
title: "feat: "
labels: ["enhancement"]
body:
- type: textarea
id: use_case
attributes:
label: Use case
description: What are you trying to build?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposal
description: The API or behavior you want.
validations:
required: true
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
groups:
cargo-patch:
update-types: [patch]
cargo-minor:
update-types: [minor]
cargo-major:
update-types: [major]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions:
patterns: ["*"]
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Summary

## Release Intent

- [ ] Package/API/runtime change: PR title uses `feat:`, `fix:`, `perf:`, `refactor:`, `revert:`, or a breaking `!`.
- [ ] Docs/CI/repository-only change: no release intended.

## Verification

- [ ] `cargo fmt --all --check`
- [ ] `cargo clippy --all-targets -- -D warnings`
- [ ] `cargo test --doc`
- [ ] `cargo test --test runtime_smoke -- --nocapture`
25 changes: 25 additions & 0 deletions .github/scripts/check-conventional-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

subject="${1:-}"

if [[ -z "${subject}" ]]; then
echo "expected a non-empty commit subject or PR title" >&2
exit 1
fi

pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9][a-z0-9._/-]*\))?(!)?: .+'

if [[ ! "${subject}" =~ ${pattern} ]]; then
cat >&2 <<EOF
Expected Conventional Commits format:
<type>(optional-scope)!: <description>

Allowed types:
build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test

Received:
${subject}
EOF
exit 1
fi
64 changes: 64 additions & 0 deletions .github/scripts/check-release-intent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set -euo pipefail

subject="${1:-}"
base_ref="${2:-origin/main}"
head_ref="${3:-HEAD}"
head_branch="${4:-}"

if [[ -z "${subject}" ]]; then
echo "expected a non-empty PR title or commit subject" >&2
exit 1
fi

release_pattern='^((feat|fix|perf|refactor|revert)(\([a-z0-9][a-z0-9._/-]*\))?(!)?|[a-z]+(\([a-z0-9][a-z0-9._/-]*\))?!): .+'
release_pr_pattern='^chore\(release\): .+'

affected_files=()

while IFS= read -r file; do
[[ -z "${file}" ]] && continue

case "${file}" in
Cargo.toml | Cargo.lock | build.rs | src/* | assets/* | examples/* | benches/*)
affected_files+=("${file}")
;;
esac
done < <(git diff --name-only "${base_ref}...${head_ref}" --)

if (( ${#affected_files[@]} == 0 )); then
exit 0
fi

if [[ "${subject}" =~ ${release_pattern} ]]; then
exit 0
fi

if [[ "${subject}" =~ ${release_pr_pattern} && "${head_branch}" == release-plz-* ]]; then
exit 0
fi

cat >&2 <<EOF
This PR changes release-affecting package files, but its title does not carry
release intent for release-plz.

Use one of these Conventional Commit types in the PR title:
feat, fix, perf, refactor, revert

Breaking changes may use any type with !, for example:
chore!: remove a deprecated API

release-plz PRs are exempt only when their branch starts with release-plz- and
their title starts with chore(release):.

Docs, CI, issue-template, and repository-only changes can keep non-release types
such as docs:, ci:, chore:, style:, or test: when they do not touch package code.

Received:
${subject}

Release-affecting files:
EOF

printf ' %s\n' "${affected_files[@]}" >&2
exit 1
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
checks:
name: Rust checks
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.92
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all --check
- name: Check default features
run: cargo check --all-targets --locked
- name: Check no default features
run: cargo check --no-default-features --all-targets --locked
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Unit and binary tests
run: cargo test --lib --bins --locked
- name: Doctests
run: cargo test --doc --locked
- name: Package
run: cargo package --locked

runtime-smoke:
name: Embedded Postgres smoke
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.92
- uses: Swatinem/rust-cache@v2
- name: Runtime smoke
run: cargo test --test runtime_smoke --locked -- --nocapture
- name: Proxy smoke
run: cargo test --test proxy_smoke --locked -- --nocapture
- name: Client compatibility
run: cargo test --test client_compat --locked -- --nocapture

supply-chain:
name: Supply chain
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@v2
41 changes: 41 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Conventional Commits

on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
push:
branches: [main]

permissions:
contents: read
pull-requests: read

concurrency:
group: conventional-commits-${{ github.ref }}
cancel-in-progress: true

jobs:
conventional:
name: Validate commit and PR title
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Check PR title
if: github.event_name == 'pull_request'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: ./.github/scripts/check-conventional-commit.sh "$PR_TITLE"
- name: Check release intent for package changes
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: ./.github/scripts/check-release-intent.sh "$PR_TITLE" "$BASE_SHA" "$HEAD_SHA" "$HEAD_BRANCH"
- name: Check HEAD commit subject
run: ./.github/scripts/check-conventional-commit.sh "$(git log -1 --pretty=%s)"
Loading