From 8a40a33fa938c17d206f0e3ab332aed456037a47 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 8 Feb 2026 01:29:41 +0100 Subject: [PATCH] adding .github/workflows/ci.yml --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..474e57a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + paths: + - grammar.js + - src/** + - test/** + - bindings/** + - tree-sitter.json + pull_request: + paths: + - grammar.js + - src/** + - test/** + - bindings/** + - tree-sitter.json + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + +jobs: + test: + name: Test parser + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up tree-sitter + uses: tree-sitter/setup-action/cli@v2 + - name: Run parser and binding tests + uses: tree-sitter/parser-test-action@v2 + with: + test-rust: true + - name: Parse sample files + uses: tree-sitter/parse-action@v4 + id: parse-files + with: + files: examples/** + - name: Upload failures artifact + uses: actions/upload-artifact@v4 + if: "!cancelled() && steps.parse-files.outcome == 'failure'" + with: + name: failures-${{runner.os}} + path: ${{steps.parse-files.outputs.failures}} + fuzz: + name: Fuzz scanner + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Check for scanner changes + id: scanner-check + run: |- + if git diff --quiet HEAD^ -- src/scanner.c; then + printf 'changed=false\n' >> "$GITHUB_OUTPUT" + else + printf 'changed=true\n' >> "$GITHUB_OUTPUT" + fi + - name: Run the fuzzer + uses: tree-sitter/fuzz-action@v4 + if: steps.scanner-check.outputs.changed == 'true'