ci: update workflows

pull/708/head
ObserverOfTime 2024-03-07 16:02:31 +07:00 committed by Amaan Qureshi
parent 03e88c170c
commit bac818933c
4 changed files with 21 additions and 11 deletions

5
.gitattributes vendored

@ -1,5 +1,9 @@
* text eol=lf
examples/crlf-line-endings.py eol=crlf
examples/python2-grammar-crlf.py eol=crlf
examples/python3-grammar-crlf.py eol=crlf
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated
@ -8,3 +12,4 @@ bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated

@ -36,22 +36,21 @@ jobs:
node-version: ${{vars.NODE_VERSION}}
- name: Set up examples
run: |-
git clone https://github.com/numpy/numpy examples/numpy --depth=1 --filter=blob:none
git clone https://github.com/django/django examples/django --depth=1 --filter=blob:none
git clone https://github.com/pallets/flask examples/flask --depth=1 --filter=blob:none
git clone https://github.com/python/cpython examples/cpython --depth=1 --filter=blob:none
git clone https://github.com/numpy/numpy examples/numpy --single-branch --depth=1 --filter=blob:none
git clone https://github.com/django/django examples/django --single-branch --depth=1 --filter=blob:none
git clone https://github.com/pallets/flask examples/flask --single-branch --depth=1 --filter=blob:none
git clone https://github.com/python/cpython examples/cpython --single-branch --depth=1 --filter=blob:none
- name: Run tests
uses: tree-sitter/parser-test-action@v1.1
uses: tree-sitter/parser-test-action@v1.2
with:
lint: true
lint: ${{runner.os == 'Linux'}}
test-library: ${{runner.os == 'Linux'}}
examples: |
corpus-files: |
examples/**/*.py
!examples/cpython/Lib/test/badsyntax_3131.py
!examples/cpython/Lib/test/badsyntax_future8.py
!examples/cpython/Lib/test/test_compile.py
!examples/cpython/Lib/test/tokenizedata/badsyntax_3131.py
!examples/cpython/Tools/build/generate_re_casefix.py
invalid-files: |
examples/cpython/Lib/test/tokenizedata/badsyntax_3131.py
fuzz:
name: Fuzz parser
runs-on: ubuntu-latest

@ -16,4 +16,8 @@ jobs:
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}

@ -5,6 +5,7 @@
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-python)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-python)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-python/)
Python grammar for [tree-sitter][].
@ -20,3 +21,4 @@ Python grammar for [tree-sitter][].
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-python?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-python?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-python?logo=pypi&logoColor=ffd242