Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

Tree-sitter parser tests

v1.1

Tree-sitter parser tests

check-square

Tree-sitter parser tests

Test a tree-sitter parser

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Tree-sitter parser tests

uses: tree-sitter/[email protected]

Learn more about this action in tree-sitter/parser-test-action

Choose a version

Tree-sitter parser tests

Options

lint:
  description: Enable linting
  default: false
generate:
  description: Verify the generated parser
  default: false
test-grammar:
  description: Test the grammar
  default: true
test-library:
  description: Test the rust library
  default: true
examples:
  description: Glob patterns of example files to parse

Example configuration

name: CI

on:
  push:
    branches: [master]
    paths:
      - grammar.js
      - src/**
      - bindings/**
      - binding.gyp
  pull_request:
    paths:
      - grammar.js
      - src/**
      - bindings/**
      - binding.gyp

jobs:
  test:
    name: Run tests
    runs-on: ubuntu-latest
    steps:
      - uses: tree-sitter/[email protected]
        with:
          node-version: 20
      - uses: tree-sitter/[email protected]
        with:
          examples: |-
            examples/*