Skip to content

Commit 86af80b

Browse files
committed
ci: update workflows
1 parent f836f66 commit 86af80b

File tree

9 files changed

+109
-210
lines changed

9 files changed

+109
-210
lines changed

.github/pull_request_template.md

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

.github/workflows/ci.yml

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

726
jobs:
827
test:
9-
runs-on: ${{ matrix.os }}
28+
name: Test parsers
29+
runs-on: ${{matrix.os}}
1030
strategy:
11-
fail-fast: true
31+
fail-fast: false
1232
matrix:
13-
os: [macos-latest, ubuntu-latest]
33+
os: [ubuntu-latest, windows-latest, macos-14]
1434
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
- name: Set up tree-sitter
38+
uses: tree-sitter/setup-action/cli@v1
39+
- name: Set up examples
40+
run: |-
41+
git clone https://github.com/desktop/desktop examples/desktop --single-branch --depth=1 --filter=blob:none
42+
git clone https://github.com/reduxjs/redux examples/redux --single-branch --depth=1 --filter=blob:none
43+
git clone https://github.com/microsoft/vscode examples/vscode --single-branch --depth=1 --filter=blob:none
44+
- name: Run tests
45+
uses: tree-sitter/parser-test-action@v2
1746
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
47+
test-rust: ${{runner.os == 'Linux'}}
48+
- name: Parse examples
49+
id: test
50+
uses: tree-sitter/parse-action@v4
2751
with:
28-
node-version: 18
29-
- run: npm install
30-
- run: npm run test-windows
52+
files: |
53+
examples/**/*.ts
54+
examples/**/*.tsx
55+
!examples/redux/src/types/store.ts

.github/workflows/fuzz.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Fuzz Parser
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- typescript/src/scanner.c
8+
- tsx/src/scanner.c
9+
- common/scanner.h
10+
pull_request:
11+
paths:
12+
- typescript/src/scanner.c
13+
- tsx/src/scanner.c
14+
- common/scanner.h
15+
16+
jobs:
17+
fuzz:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [typescript, tsx]
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Fuzz ${{matrix.language}} parser
27+
uses: tree-sitter/fuzz-action@v4
28+
with:
29+
directory: ${{matrix.language}}

.github/workflows/lint.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@ name: Lint
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [master]
6+
paths:
7+
- common/define-grammar.js
78
pull_request:
8-
branches:
9-
- "**"
9+
paths:
10+
- common/define-grammar.js
1011

1112
jobs:
1213
lint:
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v4
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}}
1623
- name: Install modules
17-
run: npm install
24+
run: npm ci --legacy-peer-deps
1825
- name: Run ESLint
1926
run: npm run lint

.github/workflows/publish.yml

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

.github/workflows/release.yml

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

script/check-generated-files

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

script/known-failures.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

script/parse-examples

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

0 commit comments

Comments
 (0)