ci: add workflows & test suite
This commit is contained in:
parent
af011e6e1a
commit
09d7e5e33d
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
57
.github/workflows/ci.yml
vendored
Normal file
57
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
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 parsers
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-14]
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Set up tree-sitter
|
||||||
|
uses: tree-sitter/setup-action/cli@v1
|
||||||
|
- name: Run tests
|
||||||
|
uses: tree-sitter/parser-test-action@v2
|
||||||
|
with:
|
||||||
|
test-rust: ${{runner.os == 'Linux'}}
|
||||||
|
- name: Set up test suite
|
||||||
|
shell: bash
|
||||||
|
run: |-
|
||||||
|
printf '%s\n' examples/*.yaml > "$RUNNER_TEMP/test-files"
|
||||||
|
while read -r file; do
|
||||||
|
printf '%s\n' "$file" >> "$RUNNER_TEMP/test-files"
|
||||||
|
if [[ -f ${file/in.yaml/error} ]]; then
|
||||||
|
printf '%s\n' "$file" >> "$RUNNER_TEMP/invalid-files"
|
||||||
|
fi
|
||||||
|
done < <(find -L examples/yaml-test-suite/name -name in.yaml)
|
||||||
|
- name: Parse test suite
|
||||||
|
uses: tree-sitter/parse-action@v4
|
||||||
|
with:
|
||||||
|
files-list: ${{runner.temp}}/test-files
|
||||||
|
invalid-files-list: ${{runner.temp}}/invalid-files
|
26
.github/workflows/fuzz.yml
vendored
Normal file
26
.github/workflows/fuzz.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
name: Fuzz
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
paths:
|
||||||
|
- src/schema.core.c
|
||||||
|
- src/scanner.c
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- src/schema.core.c
|
||||||
|
- src/scanner.c
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{github.workflow}}-${{github.ref}}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fuzz:
|
||||||
|
name: Fuzz scanner
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Run fuzzer
|
||||||
|
uses: tree-sitter/fuzz-action@v4
|
21
.github/workflows/publish.yml
vendored
Normal file
21
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
name: Publish package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["*"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
npm:
|
||||||
|
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
|
||||||
|
with:
|
||||||
|
package-name: "@tree-sitter-grammars/tree-sitter-yaml"
|
||||||
|
secrets:
|
||||||
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||||
|
crates:
|
||||||
|
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
|
||||||
|
secrets:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
|
||||||
|
pypi:
|
||||||
|
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
|
||||||
|
secrets:
|
||||||
|
PYPI_API_TOKEN: ${{secrets.PYPI_TOKEN}}
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -29,9 +29,6 @@ dist/
|
||||||
*.dll
|
*.dll
|
||||||
*.pc
|
*.pc
|
||||||
|
|
||||||
# Example dirs
|
|
||||||
/examples/*/
|
|
||||||
|
|
||||||
# Grammar volatiles
|
# Grammar volatiles
|
||||||
dsl.d.ts
|
dsl.d.ts
|
||||||
*.wasm
|
*.wasm
|
||||||
|
|
5
.gitmodules
vendored
Normal file
5
.gitmodules
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[submodule "yaml-test-suite"]
|
||||||
|
path = examples/yaml-test-suite
|
||||||
|
url = https://github.com/yaml/yaml-test-suite
|
||||||
|
branch = data
|
||||||
|
shallow = true
|
13
.travis.yml
13
.travis.yml
|
@ -1,13 +0,0 @@
|
||||||
language: rust
|
|
||||||
|
|
||||||
rust:
|
|
||||||
- stable
|
|
||||||
|
|
||||||
script:
|
|
||||||
- if [ ! -d "./tree-sitter/target/release" ]; then bash ./scripts/setup-tree-sitter.sh; fi
|
|
||||||
- ./tree-sitter/target/release/tree-sitter test
|
|
||||||
|
|
||||||
cache:
|
|
||||||
cargo: true
|
|
||||||
directories:
|
|
||||||
- ./tree-sitter
|
|
1
examples/yaml-test-suite
Submodule
1
examples/yaml-test-suite
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 6ad3d2c62885d82fc349026c136ef560838fdf3d
|
Loading…
Reference in a new issue