-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating CI for tree-sitter-teal (#30)
(Pared down from original commit list) - Update and rename test.yml to ci.yml - Update ci.yml - Create lint.yml - Create publish.yml - trying to update for new tree-sitter - rust bindings - updating package.json - updated package lock - updating binding.gyp to include scanner and added eslint config - added scanner to Package.swift and setup.py - updated rust and python bindings with queries - updated js deps
- Loading branch information
1 parent
485fbdc
commit a8901ac
Showing
34 changed files
with
8,997 additions
and
7,487 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- grammar.js | ||
- src/** | ||
- test/** | ||
- bindings/** | ||
- binding.gyp | ||
pull_request: | ||
paths: | ||
- grammar.js | ||
- src/** | ||
- test/** | ||
- bindings/** | ||
- binding.gyp | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Test parser | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-14] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up tree-sitter | ||
uses: tree-sitter/setup-action/cli@v2 | ||
- name: Run tests | ||
uses: tree-sitter/parser-test-action@v2 | ||
with: | ||
test-rust: true | ||
test-node: true | ||
test-python: true | ||
test-go: true | ||
test-swift: true | ||
- name: Parse examples | ||
uses: tree-sitter/parse-action@v4 | ||
with: | ||
files: examples/* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- grammar.js | ||
pull_request: | ||
paths: | ||
- grammar.js | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
node-version: ${{vars.NODE_VERSION}} | ||
- name: Install modules | ||
run: npm ci --legacy-peer-deps | ||
- name: Run ESLint | ||
run: npm run lint |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish packages | ||
|
||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
attestations: write | ||
|
||
jobs: | ||
github: | ||
uses: tree-sitter/workflows/.github/workflows/release.yml@main | ||
with: | ||
generate: true | ||
attestations: true | ||
# would need to setup the requisite tokens and then re-enable. | ||
# npm: | ||
# uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main | ||
# secrets: | ||
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
# with: | ||
# generate: true | ||
# crates: | ||
# uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main | ||
# secrets: | ||
# CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}} | ||
# with: | ||
# generate: true | ||
# pypi: | ||
# uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main | ||
# secrets: | ||
# PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}} | ||
# with: | ||
# generate: true |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,40 @@ | ||
node_modules | ||
build | ||
parser.so | ||
Cargo.toml | ||
Cargo.lock | ||
# Rust artifacts | ||
target/ | ||
|
||
# Node artifacts | ||
build/ | ||
prebuilds/ | ||
node_modules/ | ||
|
||
# Swift artifacts | ||
.build/ | ||
|
||
# Go artifacts | ||
_obj/ | ||
|
||
# Python artifacts | ||
.venv/ | ||
dist/ | ||
*.egg-info | ||
*.whl | ||
|
||
# C artifacts | ||
*.a | ||
*.so | ||
*.so.* | ||
*.dylib | ||
*.dll | ||
*.pc | ||
src/*.o | ||
|
||
# Example dirs | ||
/examples/*/ | ||
|
||
# Grammar volatiles | ||
*.wasm | ||
*.obj | ||
*.o | ||
|
||
# Archives | ||
*.tar.gz | ||
*.tgz | ||
*.zip |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(tree-sitter-teal | ||
VERSION "0.0.4" | ||
DESCRIPTION "Tree sitter parser for Teal, a typed dialect of Lua." | ||
HOMEPAGE_URL "https://github.com/tree-sitter/tree-sitter-teal" | ||
LANGUAGES C) | ||
|
||
option(BUILD_SHARED_LIBS "Build using shared libraries" ON) | ||
option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF) | ||
|
||
set(TREE_SITTER_ABI_VERSION 14 CACHE STRING "Tree-sitter ABI version") | ||
if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") | ||
unset(TREE_SITTER_ABI_VERSION CACHE) | ||
message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") | ||
endif() | ||
|
||
find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") | ||
|
||
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" | ||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json" | ||
COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json | ||
--abi=${TREE_SITTER_ABI_VERSION} | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
COMMENT "Generating parser.c") | ||
|
||
add_library(tree-sitter-teal src/parser.c) | ||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) | ||
target_sources(tree-sitter-teal PRIVATE src/scanner.c) | ||
endif() | ||
target_include_directories(tree-sitter-teal PRIVATE src) | ||
|
||
target_compile_definitions(tree-sitter-teal PRIVATE | ||
$<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR> | ||
$<$<CONFIG:Debug>:TREE_SITTER_DEBUG>) | ||
|
||
set_target_properties(tree-sitter-teal | ||
PROPERTIES | ||
C_STANDARD 11 | ||
POSITION_INDEPENDENT_CODE ON | ||
SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" | ||
DEFINE_SYMBOL "") | ||
|
||
configure_file(bindings/c/tree-sitter-teal.pc.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-teal.pc" @ONLY) | ||
|
||
include(GNUInstallDirs) | ||
|
||
install(FILES bindings/c/tree-sitter-teal.h | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter") | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-teal.pc" | ||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig") | ||
install(TARGETS tree-sitter-teal | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") | ||
|
||
add_custom_target(ts-test "${TREE_SITTER_CLI}" test | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
COMMENT "tree-sitter test") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "tree-sitter-teal" | ||
description = "Tree sitter parser for Teal, a typed dialect of Lua." | ||
version = "0.0.4" | ||
authors = ["euclidianAce"] | ||
license = "MIT" | ||
readme = "README.md" | ||
keywords = ["incremental", "parsing", "tree-sitter", "teal"] | ||
categories = ["parsing", "text-editors"] | ||
repository = "https://github.com/tree-sitter/tree-sitter-teal" | ||
edition = "2021" | ||
autoexamples = false | ||
|
||
build = "bindings/rust/build.rs" | ||
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*", "tree-sitter.json"] | ||
|
||
[lib] | ||
path = "bindings/rust/lib.rs" | ||
|
||
[dependencies] | ||
tree-sitter-language = "0.1" | ||
|
||
[build-dependencies] | ||
cc = "1.1.22" | ||
|
||
[dev-dependencies] | ||
tree-sitter = "0.24.4" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.