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
35 changes: 31 additions & 4 deletions Vendor/fff/.github/workflows/external-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ env:
CARGO_PROFILE_RELEASE_LTO: thin
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 16

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
lua-tests:
name: e2e (${{ matrix.os }})
runs-on: ${{ matrix.os }}
# e2e tests could be flaky on CI so we do not block release creation if they failed
continue-on-error: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
# alpine-musl installs rust via apk and has no sccache, so keep this scoped.
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
# fff-search alone exceeds the 600s default on windows, and the server
# sees no new requests while it compiles, so it would idle out mid-unit.
SCCACHE_IDLE_TIMEOUT: "0"
strategy:
fail-fast: false
matrix:
Expand All @@ -53,9 +64,19 @@ jobs:
cache-key: "v2-lua-e2e"
rustflags: ""

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.11
with:
version: v0.17.0

- name: Build Rust binary
shell: bash
run: make build
run: make build-e2e

- name: sccache stats
if: always()
shell: bash
run: sccache --show-stats

- name: Verify Windows DLL has no unexpected dependencies
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -127,7 +148,7 @@ jobs:

- name: Install node dependencies
shell: bash
run: cd packages/fff-node && npm install
run: cd packages && npm ci

- name: Run node tests
shell: bash
Expand Down Expand Up @@ -177,12 +198,14 @@ jobs:
run: cargo build --release -p fff-c

- name: Install workspace npm deps
run: npm install --no-package-lock
working-directory: packages
run: npm ci

# Upstream @yuuang/ffi-rs-linux-x64-musl ships with libc:"glibc" in
# its package.json (a publishing bug in ffi-rs), so npm filters it
# out. Force-install it so the FFI runtime is present on Alpine.
- name: Install ffi-rs musl runtime
working-directory: packages
run: |
FFI_RS_VERSION=$(node -p "require('ffi-rs/package.json').version")
npm install --no-package-lock --no-save --force \
Expand All @@ -193,13 +216,17 @@ jobs:
# this is what exercises detectLinuxLibc().
- name: Stage musl bin package
run: |
PKG_DIR=node_modules/@ff-labs/fff-bin-linux-x64-musl
PKG_DIR=packages/node_modules/@ff-labs/fff-bin-linux-x64-musl
mkdir -p "$PKG_DIR"
cp target/release/libfff_c.so "$PKG_DIR/libfff_c.so"
cat >"$PKG_DIR/package.json" <<'JSON'
{ "name": "@ff-labs/fff-bin-linux-x64-musl", "version": "0.0.0" }
JSON

# fff-node builds with bun; the npm `bun` package ships musl binaries
- name: Install bun
run: npm install -g bun

- name: Build fff-node
working-directory: packages/fff-node
run: npm run build
Expand Down
4 changes: 4 additions & 0 deletions Vendor/fff/.github/workflows/lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- '**.md'
- 'doc/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
lua-ls:
name: lua-language-server type check
Expand Down
4 changes: 4 additions & 0 deletions Vendor/fff/.github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- '**.md'
- 'doc/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
check:
runs-on: ubuntu-22.04
Expand Down
26 changes: 24 additions & 2 deletions Vendor/fff/.github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ on:
env:
CARGO_TERM_COLOR: always
MACOSX_DEPLOYMENT_TARGET: "13.0"
CARGO_PROFILE_RELEASE_LTO: thin
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 16
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
# fff-search alone exceeds the 600s default on windows, and the server sees
# no new requests while it compiles, so it would idle out mid-unit.
SCCACHE_IDLE_TIMEOUT: "0"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
test:
Expand All @@ -31,7 +42,16 @@ jobs:
persist-credentials: false

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: actions-rust-lang/setup-rust-toolchain@v1.15.4
with:
cache: true
cache-on-failure: true
cache-key: "v1-rust-python"

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.11
with:
version: v0.17.0

- name: Setup uv
uses: astral-sh/setup-uv@v5
Expand All @@ -43,6 +63,8 @@ jobs:
working-directory: packages/fff-python
shell: bash
run: |
uv sync --all-extras
# --no-install-project: uv would otherwise build the wheel via
# maturin's PEP 517 backend, then `maturin develop` builds it again.
uv sync --all-extras --no-install-project
uv run maturin develop --release
uv run pytest -v
57 changes: 49 additions & 8 deletions Vendor/fff/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build & Publish

on:
push:
branches: [main, fix/use-trusted-publishing]
branches: [main, fix/npm-pulish]
tags:
- "v*"
pull_request:
Expand All @@ -17,10 +17,18 @@ on:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
build-nvim:
name: Build Neovim ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
SCCACHE_IDLE_TIMEOUT: "0"
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -91,6 +99,11 @@ jobs:
with:
key: nvim-${{ matrix.target }}

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.11
with:
version: v0.17.0

- name: Install Zig
uses: mlugg/setup-zig@v2
with:
Expand Down Expand Up @@ -146,6 +159,10 @@ jobs:
build-c:
name: Build C FFI ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
SCCACHE_IDLE_TIMEOUT: "0"
permissions:
contents: read
strategy:
Expand Down Expand Up @@ -228,6 +245,11 @@ jobs:
with:
key: c-${{ matrix.target }}

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.11
with:
version: v0.17.0

- name: Install Zig
uses: mlugg/setup-zig@v2
with:
Expand Down Expand Up @@ -294,6 +316,10 @@ jobs:
build-mcp:
name: Build MCP ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
SCCACHE_IDLE_TIMEOUT: "0"
permissions:
contents: read
strategy:
Expand Down Expand Up @@ -344,6 +370,11 @@ jobs:
with:
key: mcp-${{ matrix.target }}

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.11
with:
version: v0.17.0

- name: Install Zig
uses: mlugg/setup-zig@v2
with:
Expand Down Expand Up @@ -478,7 +509,7 @@ jobs:
name: Release
needs: [build-nvim, build-c, build-mcp, build-python, build-python-sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/use-trusted-publishing' || startsWith(github.ref, 'refs/tags/v'))
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
permissions:
contents: write
steps:
Expand Down Expand Up @@ -612,7 +643,7 @@ jobs:

Update mcp via:
```sh
curl -fsSL https://raw.githubusercontent.com/dmtrKovalenko/fff.nvim/main/install-mcp.sh | bash
curl -fsSL https://raw.githubusercontent.com/dmtrKovalenko/fff/main/install-mcp.sh | bash
```

- name: Bump Homebrew formula (uses local checksums)
Expand All @@ -638,7 +669,7 @@ jobs:
name: Publish Python wheels to PyPI
needs: [build-python, build-python-sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/use-trusted-publishing' || startsWith(github.ref, 'refs/tags/v'))
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
environment:
name: pypi
url: https://pypi.org/p/fff-search
Expand All @@ -663,7 +694,7 @@ jobs:
name: Publish Rust crates
needs: [build-nvim, build-c, build-mcp]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/use-trusted-publishing' || startsWith(github.ref, 'refs/tags/v'))
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -694,7 +725,7 @@ jobs:
name: Publish npm packages
needs: [build-c]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/use-trusted-publishing' || startsWith(github.ref, 'refs/tags/v'))
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/npm-pulish' || startsWith(github.ref, 'refs/tags/v'))
permissions:
contents: read
id-token: write
Expand All @@ -710,6 +741,8 @@ jobs:
node-version: "25"
registry-url: "https://registry.npmjs.org"

- uses: oven-sh/setup-bun@v2

- name: Determine version
id: version
run: lua scripts/determine-version.lua
Expand Down Expand Up @@ -738,6 +771,16 @@ jobs:
fi
done

# Every install must happen before the first set-npm-version: the bump
# injects platform optionalDependencies that only resolve once published,
# and npm ci validates the whole workspace against the lockfile.
- name: Install and build JS packages
working-directory: packages
run: |
npm ci
(cd fff-bun && npm run build)
(cd fff-node && npm run build)

- name: Publish bun package
run: |
VERSION="${{ steps.version.outputs.version }}"
Expand All @@ -758,8 +801,6 @@ jobs:
make set-npm-version PKG=packages/fff-node VERSION="$VERSION"

cd packages/fff-node
npm install
npm run build
npm publish --tag "$TAG" --access public --provenance

- name: Publish pi-fff package
Expand Down
Loading