Skip to content

Commit

Permalink
ci: use upstream actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Mar 11, 2024
1 parent fc98997 commit 778990b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 43 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches: [split_parser]
paths:
- "scripts/*"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "*/test/**"
- "bindings/**"
- "binding.gyp"
pull_request:
paths:
- "scripts/*"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "*/test/**"
- "bindings/**"
- "binding.gyp"

jobs:
test:
name: Test parsers
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Set up repository
uses: tree-sitter/[email protected]
with:
node-version: ${{vars.NODE_VERSION}}
- name: Build with all extensions
run: npm run build
env:
ALL_EXTENSIONS: 1
- name: Run tests
uses: tree-sitter/[email protected]
- name: Rebuild with default extensions
run: npm run build
env:
EXTENSION_DEFAULT: 1
- name: Verify grammar consistency
run: git diff --exit-code -- */src/grammar.json
fuzz:
name: Fuzz parsers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
parser: [tree-sitter-markdown, tree-sitter-markdown-inline]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for scanner changes
id: scanner-changes
run: |-
if git diff --quiet HEAD^ -- '${{matrix.parser}}/src/scanner.c'; then
printf 'changed=false\n' >> "$GITHUB_OUTPUT"
else
printf 'changed=true\n' >> "$GITHUB_OUTPUT"
fi
- name: Fuzz ${{matrix.parser}} parser
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-changes.outputs.changed == 'true'
with:
directory: ${{matrix.parser}}
43 changes: 0 additions & 43 deletions .github/workflows/node.js.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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-markdown"
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
with:
package-name: tree-sitter-md
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}

0 comments on commit 778990b

Please sign in to comment.