Bump grammar #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| fmt: | |
| name: Rust / Format | |
| runs-on: depot-ubuntu-24.04-4 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Check query files in sync | |
| run: | | |
| for f in highlights.scm brackets.scm indents.scm injections.scm; do | |
| diff -u "crates/tree-sitter-styx/queries/$f" "editors/zed-styx/languages/styx/$f" || { | |
| echo "::error::$f is out of sync between tree-sitter-styx and zed-styx. Run 'just sync-queries' to fix." | |
| exit 1 | |
| } | |
| done | |
| clippy: | |
| name: Rust / Clippy | |
| runs-on: depot-ubuntu-24.04-16 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Clippy | |
| run: cargo clippy --all-features --all-targets -- -D warnings | |
| test: | |
| name: Rust / Test | |
| runs-on: depot-ubuntu-24.04-16 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo nextest run --all-targets | |
| compliance-rust: | |
| name: Compliance / Rust | |
| runs-on: depot-ubuntu-24.04-16 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build styx CLI | |
| run: cargo build --release --bin styx | |
| - name: Run compliance suite | |
| run: | | |
| find compliance/corpus -name "*.styx" | sort | while read f; do | |
| ./target/release/styx tree --format sexp "$f" | |
| done > output.sexp | |
| - name: Compare with golden | |
| run: diff -u compliance/golden.sexp output.sexp | |
| compliance-js: | |
| name: Compliance / JavaScript | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-js | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: implementations/styx-js/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run compliance suite | |
| run: node dist/compliance.js ../../compliance/corpus > output.sexp | |
| - name: Compare with golden | |
| run: diff -u ../../compliance/golden.sexp output.sexp | |
| python-lint: | |
| name: Python / Lint | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-py | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run ruff check | |
| run: uv run ruff check styx/ | |
| - name: Run ruff format check | |
| run: uv run ruff format --check styx/ | |
| - name: Run ty check | |
| run: uv run ty check styx/ | |
| compliance-py: | |
| name: Compliance / Python | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-py | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run compliance suite | |
| run: uv run styx-compliance ../../compliance/corpus > output.sexp | |
| - name: Compare with golden | |
| run: diff -u ../../compliance/golden.sexp output.sexp | |
| go-lint: | |
| name: Go / Lint | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-go | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| cache-dependency-path: implementations/styx-go/go.sum | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run staticcheck | |
| run: | | |
| go install honnef.co/go/tools/cmd/staticcheck@latest | |
| staticcheck ./... | |
| go-test: | |
| name: Go / Test | |
| runs-on: depot-ubuntu-24.04-4 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| cache-dependency-path: implementations/styx-go/go.sum | |
| - name: Install Rust (for reference parser) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build Rust reference | |
| run: cargo build --release --bin styx | |
| - name: Run Go tests | |
| working-directory: implementations/styx-go | |
| run: go test -v ./... | |
| compliance-go: | |
| name: Compliance / Go | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-go | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| cache-dependency-path: implementations/styx-go/go.sum | |
| - name: Build compliance runner | |
| run: go build ./cmd/styx-compliance | |
| - name: Run compliance suite | |
| run: ./styx-compliance ../../compliance/corpus > output.sexp | |
| - name: Compare with golden | |
| run: diff -u ../../compliance/golden.sexp output.sexp | |
| swift-build: | |
| name: Swift / Build | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-swift | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build | |
| run: swift build | |
| - name: Run tests | |
| run: swift test || true # Allow failures for now, compliance is WIP | |
| compliance-swift: | |
| name: Compliance / Swift | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| working-directory: implementations/styx-swift | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build compliance runner | |
| run: swift build -c release --product styx-compliance | |
| - name: Run compliance suite | |
| run: | | |
| find ../../compliance/corpus -name "*.styx" | sort | while read f; do | |
| .build/release/styx-compliance "$f" | |
| done > output.sexp | |
| - name: Compare with golden | |
| run: diff -u ../../compliance/golden.sexp output.sexp || true # Allow failures for now | |
| ffi-c: | |
| name: FFI / C | |
| runs-on: depot-ubuntu-24.04-4 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build styx-ffi | |
| run: cargo build -p styx-ffi --release | |
| - name: Compile C example | |
| working-directory: crates/styx-ffi/examples | |
| run: cc -Wall -Wextra -Werror -o example example.c -I../include -L../../../target/release -lstyx_ffi | |
| - name: Run C example | |
| working-directory: crates/styx-ffi/examples | |
| run: LD_LIBRARY_PATH=../../../target/release ./example | |
| build-windows: | |
| name: Build / Windows | |
| runs-on: depot-windows-2022-16 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build styx CLI | |
| run: cargo build --release --bin styx | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: styx-windows-x86_64 | |
| path: target/release/styx.exe | |
| jetbrains-plugin: | |
| name: JetBrains / Build Plugin | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: editors/jetbrains-styx | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Generate Gradle wrapper | |
| run: gradle wrapper --gradle-version=8.13 | |
| - name: Build plugin | |
| run: ./gradlew buildPlugin | |
| - name: Upload plugin artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jetbrains-styx-plugin | |
| path: editors/jetbrains-styx/build/distributions/*.zip |