name: Native tree-sitter libraries on: push: branches: - main paths: - 'analysis/treeSitterExcavationSite/**' # the versions of the tree-sitter core and grammars, the Java target and the start scripts - 'analysis/gradle/**' - 'analysis/build.gradle.kts' - 'analysis/ccsh/build.gradle.kts' - '.github/workflows/test_native_tree_sitter_libraries.yml' pull_request: branches: - main paths: - 'analysis/treeSitterExcavationSite/**' # the versions of the tree-sitter core and grammars, the Java target and the start scripts - 'analysis/gradle/**' - 'analysis/build.gradle.kts' - 'analysis/ccsh/build.gradle.kts' - '.github/workflows/test_native_tree_sitter_libraries.yml' permissions: contents: read jobs: native_tree_sitter_libraries: name: "Native tree-sitter libraries (${{ matrix.os }})" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: # One runner per platform the native libraries are bundled for. The images are pinned, because a "latest" # label can move to another architecture and silently drop a platform from this list. os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-2025] defaults: run: shell: bash working-directory: ./analysis steps: - uses: actions/checkout@v6 with: persist-credentials: false # Gradle has to run on the JDK it compiles with: the Kotlin compiler reads that JDK's class image inside # Gradle's own JVM, which fails across versions for a JDK with CRaC support such as Zulu - name: Setup the JDK to build with uses: actions/setup-java@v5.2.0 with: distribution: 'temurin' java-version: 25 - name: Load and parse with every grammar run: ./gradlew :treeSitterExcavationSite:test --tests "*.shared.infrastructure.ffm.*" -x jacocoTestReport - name: Build ccsh run: ./gradlew installDist - name: Setup the oldest supported Java uses: actions/setup-java@v5.2.0 with: distribution: 'temurin' java-version: 22 - name: Run ccsh on the oldest supported Java run: | java -version build/install/codecharta-analysis/bin/ccsh unifiedparser treeSitterExcavationSite/src/main -o native-smoke.cc.json test -s native-smoke.cc.json.gz - name: Run the Windows start script if: runner.os == 'Windows' shell: cmd run: build\install\codecharta-analysis\bin\ccsh.bat unifiedparser treeSitterExcavationSite\src\main -o native-smoke-bat.cc.json