66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- grammar.js
|
|
- make_grammar.js
|
|
- src/**
|
|
- test/**
|
|
- example/**
|
|
- bindings/**
|
|
- binding.gyp
|
|
pull_request:
|
|
paths:
|
|
- grammar.js
|
|
- make_grammar.js
|
|
- src/**
|
|
- test/**
|
|
- example/**
|
|
- 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-latest]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Set up tree-sitter
|
|
uses: tree-sitter/setup-action/cli@v1
|
|
- name: Regenerate with ABI 14
|
|
# TODO: remove when node & swift support ABI 15
|
|
run: |-
|
|
tree-sitter generate --abi=14
|
|
cd dialects/terraform
|
|
tree-sitter generate --abi=14
|
|
- name: Run parser and binding tests
|
|
uses: tree-sitter/parser-test-action@v2
|
|
with:
|
|
test-node: true
|
|
test-rust: ${{runner.os == 'Linux'}}
|
|
test-swift: ${{runner.os == 'macOS'}}
|
|
- name: Parse sample files
|
|
uses: tree-sitter/parse-action@v4
|
|
id: parse-files
|
|
with:
|
|
files: |-
|
|
example/**/*.hcl
|
|
example/**/*.tf
|
|
- name: Upload failures artifact
|
|
uses: actions/upload-artifact@v4
|
|
if: "!cancelled() && steps.parse-files.outcome == 'failure'"
|
|
with:
|
|
name: failures-${{runner.os}}
|
|
path: ${{steps.parse-files.outputs.failures}}
|