Skip to content

Commit bd77b6a

Browse files
committed
ci: update workflows
1 parent 948a3fa commit bd77b6a

File tree

7 files changed

+100
-183
lines changed

7 files changed

+100
-183
lines changed

.github/pull_request_template.md

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

.github/workflows/ci.yml

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,61 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [master]
6+
paths:
7+
- "scripts.js"
8+
- "common/*"
9+
- "*/grammar.js"
10+
- "*/src/**"
11+
- "bindings/**"
12+
- "binding.gyp"
713
pull_request:
8-
branches:
9-
- master
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
1025

1126
jobs:
1227
test:
13-
runs-on: ${{ matrix.os }}
28+
name: Test parsers
29+
runs-on: ${{matrix.os}}
1430
strategy:
1531
fail-fast: false
1632
matrix:
17-
os: [macos-latest, ubuntu-latest]
33+
os: [ubuntu-latest, windows-latest, macos-14]
1834
steps:
19-
- uses: actions/checkout@v4
20-
- 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/laravel/laravel examples/laravel --single-branch --depth=1 --filter=blob:none
42+
git clone https://github.com/laravel/framework examples/framework --single-branch --depth=1 --filter=blob:none
43+
git clone https://github.com/phacility/phabricator examples/phabricator --single-branch --depth=1 --filter=blob:none
44+
git clone https://github.com/sebastianbergmann/phpunit examples/phpunit --single-branch --depth=1 --filter=blob:none
45+
git clone https://github.com/WordPress/WordPress examples/WordPress --single-branch --depth=1 --filter=blob:none
46+
git clone https://github.com/wikimedia/mediawiki examples/mediawiki --single-branch --depth=1 --filter=blob:none
47+
- name: Run tests
48+
uses: tree-sitter/parser-test-action@v2
2149
with:
22-
node-version: 18
23-
- uses: actions/setup-python@v4
50+
test-rust: ${{runner.os == 'Linux'}}
51+
- name: Parse examples
52+
id: test
53+
uses: tree-sitter/parse-action@v4
54+
continue-on-error: true
2455
with:
25-
python-version: '3.12'
26-
- run: npm install
27-
- run: npm test
28-
- run: npm run test-examples
29-
test_windows:
30-
runs-on: windows-latest
31-
steps:
32-
- uses: actions/checkout@v4
33-
- uses: actions/setup-node@v4
56+
files: |
57+
examples/**/*.php
58+
- uses: actions/upload-artifact@v4
59+
if: steps.test.outputs.failures != ''
3460
with:
35-
node-version: 18
36-
- run: npm install
37-
- run: npm test
61+
name: failures
62+
path: ${{steps.test.outputs.failures}}

.github/workflows/fuzz.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Fuzz Parser
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- php/src/scanner.c
8+
- php_only/src/scanner.c
9+
- common/scanner.h
10+
pull_request:
11+
paths:
12+
- php/src/scanner.c
13+
- php_only/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: [php, php_only]
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}}
30+
tree-sitter-version: v0.22.5

.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/known-failures.txt

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

script/parse-examples

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

0 commit comments

Comments
 (0)