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
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "08:00"
timezone: "UTC"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
labels:
- "dependencies"
- "rust"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "08:30"
timezone: "UTC"
open-pull-requests-limit: 10
commit-message:
prefix: "deps(ci)"
labels:
- "dependencies"
- "ci"
63 changes: 63 additions & 0 deletions .github/workflows/auto-bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: auto-bump-version

on:
push:
branches:
- main
paths:
- Cargo.lock

permissions:
contents: write

jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump patch version when dependencies changed without version update
shell: bash
run: |
set -euo pipefail

before="${{ github.event.before }}"
if [ -z "$before" ] || [ "$before" = "0000000000000000000000000000000000000000" ]; then
echo "No valid previous commit SHA, skipping."
exit 0
fi

if ! git cat-file -e "${before}^{commit}" 2>/dev/null; then
git fetch --no-tags --depth=1 origin "$before"
fi

prev_version="$(git show "$before:Cargo.toml" | sed -n 's/^version = "\(.*\)"/\1/p' | head -n1 || true)"
curr_version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1 || true)"

if [ -z "$prev_version" ] || [ -z "$curr_version" ]; then
echo "Unable to determine versions, skipping."
exit 0
fi

if [ "$prev_version" != "$curr_version" ]; then
echo "Version already changed ($prev_version -> $curr_version), skipping."
exit 0
fi

changed_files="$(git diff --name-only "$before" "$GITHUB_SHA")"
if ! printf '%s\n' "$changed_files" | grep -qx "Cargo.lock"; then
echo "No Cargo.lock change detected, skipping."
exit 0
fi

new_version="$(ci/bump_patch_version.sh Cargo.toml)"
echo "Bumped patch version to $new_version"

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add Cargo.toml
git commit -m "chore(release): bump version to $new_version after dependency updates"
git push
58 changes: 58 additions & 0 deletions .github/workflows/auto-tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: auto-tag-release

on:
push:
branches:
- main
paths:
- Cargo.toml

permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create release tag from Cargo.toml version bump
shell: bash
run: |
set -euo pipefail

before="${{ github.event.before }}"
if [ -z "$before" ] || [ "$before" = "0000000000000000000000000000000000000000" ]; then
echo "No valid previous commit SHA, skipping."
exit 0
fi

if ! git cat-file -e "${before}^{commit}" 2>/dev/null; then
git fetch --no-tags --depth=1 origin "$before"
fi

prev_version="$(git show "$before:Cargo.toml" | sed -n 's/^version = "\(.*\)"/\1/p' | head -n1 || true)"
curr_version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1 || true)"

if [ -z "$prev_version" ] || [ -z "$curr_version" ]; then
echo "Unable to determine versions, skipping."
exit 0
fi

if [ "$prev_version" = "$curr_version" ]; then
echo "Version did not change, skipping."
exit 0
fi

if git rev-parse -q --verify "refs/tags/$curr_version" >/dev/null; then
echo "Tag $curr_version already exists, skipping."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$curr_version" -m "$curr_version"
git push origin "$curr_version"
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,36 @@ jobs:
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --workspace

mrshv2-ffi-smoke:
name: mrshv2-ffi-smoke
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install packages (Ubuntu)
run: |
ci/ubuntu-install-packages

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Build MRSHv2 mock adapter
shell: bash
run: |
set -euo pipefail
mock_dir="$RUNNER_TEMP/mrshv2-mock"
mkdir -p "$mock_dir"
ci/build_mrshv2_mock.sh "$mock_dir"
echo "PRECURSOR_MRSHV2_LIB_DIR=$mock_dir" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$mock_dir:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"

- name: Run tests with MRSHv2 feature enabled
shell: bash
run: |
cargo test --verbose --workspace --features similarity-mrshv2
45 changes: 45 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: pages

on:
push:
branches:
- main
paths:
- site/**
- .github/workflows/pages.yml
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload static site artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading