Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed May 6, 2024
1 parent f836f66 commit 86af80b
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 210 deletions.
7 changes: 0 additions & 7 deletions .github/pull_request_template.md

This file was deleted.

63 changes: 44 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches: [master]
paths:
- "scripts.js"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "bindings/**"
- "binding.gyp"
pull_request:
paths:
- "scripts.js"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "bindings/**"
- "binding.gyp"

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
name: Test parsers
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Set up examples
run: |-
git clone https://github.com/desktop/desktop examples/desktop --single-branch --depth=1 --filter=blob:none
git clone https://github.com/reduxjs/redux examples/redux --single-branch --depth=1 --filter=blob:none
git clone https://github.com/microsoft/vscode examples/vscode --single-branch --depth=1 --filter=blob:none
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
node-version: 18
- run: npm install
- run: npm test

test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
test-rust: ${{runner.os == 'Linux'}}
- name: Parse examples
id: test
uses: tree-sitter/parse-action@v4
with:
node-version: 18
- run: npm install
- run: npm run test-windows
files: |
examples/**/*.ts
examples/**/*.tsx
!examples/redux/src/types/store.ts
29 changes: 29 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Fuzz Parser

on:
push:
branches: [master]
paths:
- typescript/src/scanner.c
- tsx/src/scanner.c
- common/scanner.h
pull_request:
paths:
- typescript/src/scanner.c
- tsx/src/scanner.c
- common/scanner.h

jobs:
fuzz:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [typescript, tsx]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fuzz ${{matrix.language}} parser
uses: tree-sitter/fuzz-action@v4
with:
directory: ${{matrix.language}}
19 changes: 13 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ name: Lint

on:
push:
branches:
- master
branches: [master]
paths:
- common/define-grammar.js
pull_request:
branches:
- "**"
paths:
- common/define-grammar.js

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install modules
run: npm install
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish package

on:
push:
tags: ["*"]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
103 changes: 0 additions & 103 deletions .github/workflows/release.yml

This file was deleted.

19 changes: 0 additions & 19 deletions script/check-generated-files

This file was deleted.

1 change: 0 additions & 1 deletion script/known-failures.txt

This file was deleted.

55 changes: 0 additions & 55 deletions script/parse-examples

This file was deleted.

0 comments on commit 86af80b

Please sign in to comment.