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
122 changes: 122 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: CI

on:
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
linux:
name: Linux (all checks)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-ci-
${{ runner.os }}-cargo-

- name: Check formatting
run: cargo fmt --all --check

- name: Check (default features)
run: cargo check

- name: Check (all features)
run: cargo check --features full

- name: Clippy
run: cargo clippy --features full --all-targets -- -D warnings

- name: Run tests (default features)
run: cargo test

- name: Run tests (all features)
run: cargo test --features full

- name: Build documentation
run: cargo doc --features full --no-deps
env:
RUSTDOCFLAGS: -D warnings

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-ci-
${{ runner.os }}-cargo-

- name: Check (all features)
run: cargo check --features full

- name: Run tests (all features)
run: cargo test --features full

macos:
name: macOS (Intel)
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-ci-
${{ runner.os }}-cargo-

- name: Check (all features)
run: cargo check --features full

- name: Run tests (all features)
run: cargo test --features full

msrv:
name: MSRV (1.83)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust 1.83
uses: dtolnay/rust-toolchain@1.83

- name: Check MSRV
run: cargo check --features full
201 changes: 201 additions & 0 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: JIT CI

on:
push:
branches:
- '**/jit/**'
- 'jit/**'
- '**/jit'
- 'jit-*'
- '*-jit'
- '*-jit-*'
pull_request:
branches:
- main
paths:
- 'src/jit/**'
- 'src/vm/*/jit/**'
- 'src/nfa/tagged/jit/**'

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-jit-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-jit-
${{ runner.os }}-cargo-

- name: Check (no features)
run: cargo check --no-default-features

- name: Check (jit only)
run: cargo check --features jit

- name: Check (full)
run: cargo check --features full

- name: Test (no JIT)
run: cargo test --no-default-features

- name: Test (JIT only)
run: cargo test --features jit

- name: Test (full)
run: cargo test --features full

linux-arm64:
name: Linux (ARM64)
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-arm64-cargo-jit-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-arm64-cargo-jit-
${{ runner.os }}-arm64-cargo-

- name: Check (no features)
run: cargo check --no-default-features

- name: Check (jit only)
run: cargo check --features jit

- name: Test (no JIT)
run: cargo test --no-default-features

- name: Test (JIT only)
run: cargo test --features jit

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-jit-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-jit-
${{ runner.os }}-cargo-

- name: Check (full)
run: cargo check --features full

- name: Test (full)
run: cargo test --features full

macos-intel:
name: macOS (Intel x86_64)
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-intel-cargo-jit-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-intel-cargo-jit-
${{ runner.os }}-intel-cargo-

- name: Check (full)
run: cargo check --features full

- name: Test (full)
run: cargo test --features full

macos-arm64:
name: macOS (ARM64 Apple Silicon)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-arm64-cargo-jit-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-arm64-cargo-jit-
${{ runner.os }}-arm64-cargo-

- name: Check (no features)
run: cargo check --no-default-features

- name: Check (jit only)
run: cargo check --features jit

- name: Check (full)
run: cargo check --features full

- name: Test (no JIT)
run: cargo test --no-default-features

- name: Test (JIT only) - Debug ARM64
run: |
echo "=== Running JIT tests on ARM64 ==="
echo "Architecture: $(uname -m)"
cargo test --features jit -- --test-threads=1 2>&1 || {
echo "=== JIT tests failed, running individual test files ==="
cargo test --features jit --lib -- --test-threads=1 || true
cargo test --features jit --test api -- --test-threads=1 || true
cargo test --features jit --test engines -- --test-threads=1 || true
cargo test --features jit --test features -- --test-threads=1 || true
cargo test --features jit --test patterns -- --test-threads=1 || true
cargo test --features jit --test unicode -- --test-threads=1 || true
echo "=== Individual test runs complete ==="
exit 1
}

- name: Test (full)
run: cargo test --features full
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "regexr"
version = "0.1.0"
version = "0.1.0-beta.3"
edition = "2021"
authors = ["Farhan Syah"]
description = "A high-performance regex engine built from scratch with JIT compilation and SIMD acceleration"
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,20 @@ assert_eq!(result, "abc NUM def NUM");
## Feature Flags

- `simd` (default): Enables SIMD-accelerated literal search
- `jit`: Enables JIT compilation for x86-64
- `jit`: Enables JIT compilation (x86-64 and ARM64)
- `full`: Enables both JIT and SIMD

### Platform Support

| Platform | JIT Support | SIMD Support |
|----------|-------------|--------------|
| Linux x86-64 | ✓ | ✓ (AVX2) |
| Linux ARM64 | ✓ | ✗ |
| macOS x86-64 | ✓ | ✓ (AVX2) |
| macOS ARM64 (Apple Silicon) | ✓ | ✗ |
| Windows x86-64 | ✓ | ✓ (AVX2) |
| Other | ✗ | ✗ |

Build without default features for a minimal installation:

```bash
Expand Down
Loading