Skip to content

Commit 198ab94

Browse files
committed
Initial commit
0 parents  commit 198ab94

37 files changed

Lines changed: 7371 additions & 0 deletions

.cargo/config.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[target.x86_64-apple-darwin]
2+
rustflags = [
3+
"-C", "link-arg=-undefined",
4+
"-C", "link-arg=dynamic_lookup",
5+
]
6+
7+
[target.aarch64-apple-darwin]
8+
rustflags = [
9+
"-C", "link-arg=-undefined",
10+
"-C", "link-arg=dynamic_lookup",
11+
]
12+
13+
[target.x86_64-unknown-linux-musl]
14+
rustflags = ["-C", "target-feature=-crt-static"]
15+
16+
[target.aarch64-unknown-linux-musl]
17+
rustflags = ["-C", "target-feature=-crt-static"]
18+
19+
[target.aarch64-linux-android]
20+
rustflags = [
21+
"-C",
22+
"linker=aarch64-linux-android-clang",
23+
"-C",
24+
"link-args=-rdynamic",
25+
"-C",
26+
"default-linker-libraries",
27+
]

.github/workflows/panvimdoc.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update vimdocs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- doc/**
8+
- .github/workflows/panvimdoc.yaml
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
docs:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: kdheepak/panvimdoc@main
19+
with:
20+
vimdoc: fff
21+
pandoc: doc/vimdoc.md
22+
version: NVIM v0.10.0
23+
shiftheadinglevelby: 0
24+
incrementheadinglevelby: 0
25+
- uses: stefanzweifel/git-auto-commit-action@v5
26+
with:
27+
commit_message: "docs: update vimdocs"
28+
branch: ${{ github.head_ref }}

.github/workflows/release.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
name: Build ${{ matrix.target }}
11+
runs-on: ${{ matrix.os }}
12+
permissions:
13+
contents: read
14+
strategy:
15+
matrix:
16+
include:
17+
## Linux builds
18+
# Glibc 2.21
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-gnu
21+
artifact_name: target/x86_64-unknown-linux-gnu/release/libfff_fuzzy.so
22+
- os: ubuntu-latest
23+
target: aarch64-unknown-linux-gnu
24+
artifact_name: target/aarch64-unknown-linux-gnu/release/libfff_fuzzy.so
25+
# Musl 1.2.3
26+
- os: ubuntu-latest
27+
target: x86_64-unknown-linux-musl
28+
artifact_name: target/x86_64-unknown-linux-musl/release/libfff_fuzzy.so
29+
- os: ubuntu-latest
30+
target: aarch64-unknown-linux-musl
31+
artifact_name: target/aarch64-unknown-linux-musl/release/libfff_fuzzy.so
32+
# Android (Termux)
33+
- os: ubuntu-latest
34+
target: aarch64-linux-android
35+
artifact_name: target/aarch64-linux-android/release/libfff_fuzzy.so
36+
37+
## macOS builds
38+
- os: macos-latest
39+
target: x86_64-apple-darwin
40+
artifact_name: target/x86_64-apple-darwin/release/libfff_fuzzy.dylib
41+
- os: macos-latest
42+
target: aarch64-apple-darwin
43+
artifact_name: target/aarch64-apple-darwin/release/libfff_fuzzy.dylib
44+
45+
## Windows builds
46+
- os: windows-latest
47+
target: x86_64-pc-windows-msvc
48+
artifact_name: target/x86_64-pc-windows-msvc/release/fff_fuzzy.dll
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
persist-credentials: false
54+
55+
- name: Set Rust toolchain
56+
if: contains(matrix.target, 'linux')
57+
# https://github.com/rust-cross/cargo-zigbuild/issues/327
58+
run: echo -e '[toolchain]\nchannel = "nightly-2025-02-19"' > rust-toolchain.toml
59+
60+
- name: Install Rust
61+
run: |
62+
# https://github.com/rust-cross/cargo-zigbuild/issues/327
63+
rustup toolchain install nightly-2025-02-19
64+
rustup default nightly-2025-02-19
65+
rustup target add ${{ matrix.target }}
66+
67+
- name: Build for Linux
68+
if: contains(matrix.os, 'ubuntu')
69+
run: |
70+
cargo install cross --git https://github.com/cross-rs/cross
71+
cross build --release --target ${{ matrix.target }}
72+
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.so"
73+
74+
- name: Build for macOS
75+
if: contains(matrix.os, 'macos')
76+
run: |
77+
# Ventura (https://en.wikipedia.org/wiki/MacOS_version_history#Releases)
78+
MACOSX_DEPLOYMENT_TARGET="13" cargo build --release --target ${{ matrix.target }}
79+
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.dylib"
80+
81+
- name: Build for Windows
82+
if: contains(matrix.os, 'windows')
83+
run: |
84+
cargo build --release --target ${{ matrix.target }}
85+
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.dll"
86+
87+
- name: Upload artifacts
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ${{ matrix.target }}
91+
path: ${{ matrix.target }}.*
92+
93+
release:
94+
name: Release
95+
needs: build
96+
runs-on: ubuntu-latest
97+
permissions:
98+
contents: write
99+
steps:
100+
- name: Download artifacts
101+
uses: actions/download-artifact@v4
102+
103+
- name: Generate checksums
104+
run: |
105+
for file in ./**/*; do
106+
sha256sum "$file" > "${file}.sha256"
107+
done
108+
109+
- name: Upload Release Assets
110+
uses: softprops/action-gh-release@v2
111+
with:
112+
name: ${{ github.ref_name }}
113+
tag_name: ${{ github.ref_name }}
114+
token: ${{ github.token }}
115+
files: ./**/*
116+
draft: false
117+
prerelease: false
118+
generate_release_notes: true

.github/workflows/spelling.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Spelling
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
env:
13+
CLICOLOR: 1
14+
15+
jobs:
16+
spelling:
17+
name: Spell Check with Typos
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
24+
- name: Spell Check Repo
25+
uses: crate-ci/typos@685eb3d55be2f85191e8c84acb9f44d7756f84ab # v1.29.4

.github/workflows/stylua.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Stylua
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- "**/*.lua"
12+
- .stylua.toml
13+
- .github/workflows/stylua.yaml
14+
pull_request:
15+
paths:
16+
- "**/*.lua"
17+
- .stylua.toml
18+
- .github/workflows/stylua.yaml
19+
20+
env:
21+
CLICOLOR: 1
22+
23+
jobs:
24+
stylua:
25+
name: Check lua files using Stylua
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
32+
- name: Stylua Check Repo
33+
uses: JohnnyMorganz/stylua-action@v4
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
version: latest
37+
args: --color=always --check .

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
doc/tags
2+
target/
3+
.archive.lua
4+
_*.lua
5+
.lazy.lua
6+
dual/
7+
result
8+
.direnv
9+
.devenv
10+
.repro/
11+
.wrangler/
12+
*.so

.stylua.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
syntax = "LuaJIT"
2+
column_width = 120
3+
line_endings = "Unix"
4+
indent_type = "Spaces"
5+
indent_width = 2
6+
quote_style = "AutoPreferSingle"
7+
call_parentheses = "Always"
8+
collapse_simple_statement = "Always"

0 commit comments

Comments
 (0)