Skip to content

Commit 5a03bd2

Browse files
committed
ci: update workflows
1 parent 075ebfc commit 5a03bd2

File tree

4 files changed

+92
-19
lines changed

4 files changed

+92
-19
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,48 @@
11
name: CI
2+
23
on:
3-
workflow_dispatch:
4-
pull_request:
54
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
- src/**
9+
- test/**
10+
- bindings/**
11+
- binding.gyp
12+
pull_request:
13+
paths:
14+
- grammar.js
15+
- src/**
16+
- test/**
17+
- bindings/**
18+
- binding.gyp
19+
20+
concurrency:
21+
group: ${{github.workflow}}-${{github.ref}}
22+
cancel-in-progress: true
623

724
jobs:
825
test:
9-
runs-on: ${{ matrix.os }}
26+
name: Test parser
27+
runs-on: ${{matrix.os}}
1028
strategy:
11-
fail-fast: true
29+
fail-fast: false
1230
matrix:
13-
os: [macos-latest, ubuntu-latest]
31+
os: [ubuntu-latest, windows-latest, macos-14]
1432
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- name: Set up tree-sitter
36+
uses: tree-sitter/setup-action/cli@v1
37+
- name: Run tests
38+
uses: tree-sitter/parser-test-action@v2
1739
with:
18-
node-version: 18
19-
- run: npm install
20-
- run: npm test
21-
22-
test_windows:
23-
runs-on: windows-latest
24-
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v4
40+
test-rust: true
41+
test-node: true
42+
test-python: true
43+
test-go: true
44+
test-swift: true
45+
- name: Parse examples
46+
uses: tree-sitter/parse-action@v4
2747
with:
28-
node-version: 18
29-
- run: npm install
30-
- run: npm run test-windows
48+
files: examples/*

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
pull_request:
9+
paths:
10+
- grammar.js
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: npm
22+
node-version: ${{vars.NODE_VERSION}}
23+
- name: Install modules
24+
run: npm ci --legacy-peer-deps
25+
- name: Run ESLint
26+
run: npm run lint

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
jobs:
8+
github:
9+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
10+
npm:
11+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
12+
secrets:
13+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
14+
crates:
15+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
16+
secrets:
17+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
18+
pypi:
19+
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
20+
secrets:
21+
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}

0 commit comments

Comments
 (0)