feat: Add prebuilt tree-sitter grammars for Semble #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run tests and upload coverage | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Run tests with pytest | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff | |
| - name: Create virtual environment | |
| run: uv venv .venv | |
| - name: Add venv to PATH | |
| shell: bash | |
| run: | | |
| echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
| if [ "$RUNNER_OS" = "Windows" ]; then | |
| echo "$PWD/.venv/Scripts" >> $GITHUB_PATH | |
| else | |
| echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| fi | |
| - name: Install dependencies | |
| shell: bash | |
| run: make install | |
| - name: Install tree-sitter CLI | |
| shell: bash | |
| run: npm install -g tree-sitter-cli | |
| - name: Install MinGW-w64 (Windows only) | |
| if: runner.os == 'Windows' | |
| run: choco install mingw --no-progress -y | |
| - name: Build grammar bundle for this runner's platform | |
| shell: bash | |
| run: uv run python tools/build_grammars.py | |
| - name: Run tests under coverage | |
| shell: bash | |
| run: | | |
| coverage run --source=semble_grammars -m pytest | |
| coverage report | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |