-
Notifications
You must be signed in to change notification settings - Fork 34
chore: CI workflow update #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| 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: Set up examples | ||
| shell: bash | ||
| run: |- | ||
| git clone https://github.com/nushell/nu_scripts examples/nu_scripts -q --single-branch --depth=1 | ||
| - name: Run tests | ||
| uses: tree-sitter/parser-test-action@v2 | ||
| with: | ||
| generate: false | ||
| test-rust: true | ||
| test-node: true | ||
| test-python: true | ||
| test-go: true | ||
| test-swift: false | ||
| - name: Parse examples | ||
| uses: tree-sitter/parse-action@v4 | ||
| with: | ||
| files: |- | ||
| examples/nu_scripts/**/*.nu | ||
| invalid-files-list: script/known-failures.txt |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| 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 | ||
| - name: Run Prettier | ||
| run: npm run format |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| 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 | ||
| # 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,48 @@ | ||
| node_modules/ | ||
| log.html | ||
| # Rust artifacts | ||
| target/ | ||
|
|
||
| /build/ | ||
| # 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 | ||
| *.exp | ||
| *.lib | ||
|
|
||
| # C lsp cache | ||
| .ccls-cache/ | ||
| # Zig artifacts | ||
| .zig-cache/ | ||
| zig-cache/ | ||
| zig-out/ | ||
|
|
||
| # Workspace Config | ||
| .nvim/ | ||
| # .vscode/ | ||
| # Example dirs | ||
| /examples/*/ | ||
| /script/example-files.txt | ||
|
|
||
| # MSVC compile output | ||
| /parser.exp | ||
| /parser.lib | ||
| /parser.obj | ||
| # Grammar volatiles | ||
| *.wasm | ||
| *.obj | ||
| *.o | ||
|
|
||
| # macOS junk | ||
| .DS_Store | ||
| # Archives | ||
| *.tar.gz | ||
| *.tgz | ||
| *.zip |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "printWidth": 80, | ||
| "trailingComma": "all" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| cmake_minimum_required(VERSION 3.13) | ||
|
|
||
| project(tree-sitter-nu | ||
| VERSION "0.0.1" | ||
| DESCRIPTION "Nu grammar for tree-sitter" | ||
| HOMEPAGE_URL "https://github.com/nushell/tree-sitter-nu" | ||
| 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-nu src/parser.c) | ||
| if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) | ||
| target_sources(tree-sitter-nu PRIVATE src/scanner.c) | ||
| endif() | ||
| target_include_directories(tree-sitter-nu | ||
| PRIVATE src | ||
| INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | ||
|
|
||
|
|
||
| target_compile_definitions(tree-sitter-nu PRIVATE | ||
| $<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR> | ||
| $<$<CONFIG:Debug>:TREE_SITTER_DEBUG>) | ||
|
|
||
| set_target_properties(tree-sitter-nu | ||
| PROPERTIES | ||
| C_STANDARD 11 | ||
| POSITION_INDEPENDENT_CODE ON | ||
| SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" | ||
| DEFINE_SYMBOL "") | ||
|
|
||
| configure_file(bindings/c/tree-sitter-nu.pc.in | ||
| "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-nu.pc" @ONLY) | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter" | ||
| DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
| FILES_MATCHING PATTERN "*.h") | ||
| install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-nu.pc" | ||
| DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig") | ||
| install(TARGETS tree-sitter-nu | ||
| 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 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.