Skip to content

Commit 8c899c5

Browse files
committed
ci: Add GitHub workflows from tree-sitter/workflows
1 parent 665f393 commit 8c899c5

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- grammar.js
8+
- src/**
9+
- bindings/**
10+
- binding.gyp
11+
pull_request:
12+
paths:
13+
- grammar.js
14+
- src/**
15+
- bindings/**
16+
- binding.gyp
17+
18+
concurrency:
19+
group: ${{github.workflow}}-${{github.ref}}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
test:
24+
name: Run tests
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: tree-sitter/setup-action/cli@v2
29+
- uses: tree-sitter/parser-test-action@v3
30+
with:
31+
test-rust: true
32+
test-node: true
33+
test-python: true

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
concurrency:
8+
group: ${{github.workflow}}-${{github.ref}}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: write
13+
id-token: write
14+
attestations: write
15+
16+
jobs:
17+
github:
18+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
19+
with:
20+
generate: true
21+
attestations: true
22+
npm:
23+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
24+
secrets:
25+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
26+
with:
27+
generate: true
28+
crates:
29+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
30+
secrets:
31+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
32+
with:
33+
generate: true
34+
pypi:
35+
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
36+
secrets:
37+
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
38+
with:
39+
generate: true

0 commit comments

Comments
 (0)