Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit c56afb2

Browse files
committed
ci: add test and lint actions
1 parent cac392a commit c56afb2

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
os: [macos-latest, ubuntu-latest]
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
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@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 18
29+
- run: npm install
30+
- run: npm run test-windows

.github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Install modules
17+
run: npm install
18+
- name: Run ESLint
19+
run: npm run lint

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"scripts": {
2323
"build": "tree-sitter generate && node-gyp build",
24+
"lint": "eslint grammar.js",
2425
"test": "tree-sitter test && tree-sitter parse examples/* --quiet --time",
2526
"test-windows": "tree-sitter test"
2627
},

0 commit comments

Comments
 (0)