diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd7a419..ef1db78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,23 +1,40 @@ name: CI on: - pull_request: - branches: - - "**" push: - branches: - - "master" + branches: [master] + paths: + - grammar.js + - src/** + - test/** + - bindings/** + - binding.gyp + pull_request: + paths: + - grammar.js + - src/** + - test/** + - bindings/** + - binding.gyp + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + jobs: test: - runs-on: ${{ matrix.os }} + name: Test parser + runs-on: ${{matrix.os}} strategy: - fail-fast: true + fail-fast: false matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-14] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up tree-sitter + uses: tree-sitter/setup-action/cli@v1 + - name: Run tests + uses: tree-sitter/parser-test-action@v2 with: - node-version: 18 - - run: npm install - - run: npm test + test-rust: ${{runner.os == 'Linux'}} diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 58b9e1a..ad67d88 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -2,21 +2,18 @@ name: Fuzz Parser on: push: + branches: [master] paths: - src/scanner.c pull_request: paths: - src/scanner.c - workflow_dispatch: jobs: - test: - name: Parser fuzzing + fuzz: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: vigoux/tree-sitter-fuzz-action@v1 - with: - language: jsdoc - external-scanner: src/scanner.c - time: 60 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run fuzzer + uses: tree-sitter/fuzz-action@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d94f7f3..96f1a4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,18 +2,25 @@ name: Lint on: push: - branches: - - master + branches: [master] + paths: + - grammar.js pull_request: - branches: - - "**" + paths: + - grammar.js jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - 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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..cb7e16b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish packages + +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}}