Skip to content

Commit 7337b81

Browse files
committed
ci: update workflows
1 parent e07d254 commit 7337b81

File tree

4 files changed

+67
-84
lines changed

4 files changed

+67
-84
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
49

5-
jobs:
6-
bless:
7-
name: Bless
8-
runs-on: ubuntu-latest
10+
concurrency:
11+
group: ${{github.workflow}}-${{github.ref}}
12+
cancel-in-progress: true
913

14+
jobs:
15+
test:
16+
name: Test parser
17+
runs-on: ${{matrix.os}}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, windows-latest, macos-latest]
1022
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v2
23+
- name: Set up repository
24+
uses: actions/checkout@v4
1325

14-
- name: Install Node
15-
uses: actions/setup-node@v2
26+
- name: Set up tree-sitter
27+
uses: tree-sitter/setup-action@v2
1628
with:
17-
node-version: "14.x"
29+
install-lib: false
1830

19-
- name: Cache npm dependencies
20-
uses: actions/cache@v2
21-
with:
22-
path: ~/.npm
23-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
24-
restore-keys: |
25-
${{ runner.os }}-node-
31+
- name: Run tests
32+
uses: tree-sitter/parser-test-action@v2
2633

27-
- name: Install npm dependencies
28-
run: npm ci
34+
query:
35+
name: Validate queries
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Set up repository
39+
uses: actions/checkout@v4
40+
41+
- name: Set up tree-sitter
42+
uses: tree-sitter/setup-action@v2
43+
with:
44+
install-lib: false
2945

30-
- name: Ensure generated parser files are up to date
31-
run: npx tree-sitter generate
46+
- name: Build parser
47+
run: tree-sitter build
3248

33-
- name: Run tree-sitter tests
34-
run: npx tree-sitter test
49+
- name: Set up ts_query_ls
50+
run: curl -fL https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz | tar -xz
3551

36-
- name: Check formatting
37-
run: npx prettier --trailing-comma es5 --check grammar.js
52+
- name: Check queries
53+
run: ./ts_query_ls check -f queries/

.github/workflows/generate-parser.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{github.workflow}}-${{github.ref}}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write
14+
id-token: write
15+
attestations: write
16+
17+
jobs:
18+
release:
19+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
20+
with:
21+
attestations: true
22+

.tsqueryrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json",
3+
"parser_install_directories": ["."]
4+
}

0 commit comments

Comments
 (0)