Add test workflow

This commit is contained in:
Jonatan Kłosko 2021-09-30 12:36:21 +02:00
parent e846449ef6
commit 8f1f7bc427
2 changed files with 33 additions and 1 deletions

32
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Cache npm dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm ci
- name: Check formatting
run: npm run format-check
# Ensure the generated parser is up to date
- run: npx tree-sitter generate
- name: Run Tree-sitter tests
run: npx tree-sitter test
- name: Run integration tests
run: scripts/integration_test.sh

View File

@ -1,6 +1,6 @@
# tree-sitter-elixir
[![Test](https://github.com/jonatanklosko/tree-sitter-elixir/actions/workflows/test.yml/badge.svg)](https://github.com/jonatanklosko/tree-sitter-elixir/actions/workflows/test.yml)
[![Test](https://github.com/elixir-lang/tree-sitter-elixir/actions/workflows/test.yml/badge.svg)](https://github.com/elixir-lang/tree-sitter-elixir/actions/workflows/test.yml)
Elixir grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).