gruggers 0.9.0

rust implementation of the grug language
name: CI Build Grammar

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    name: Grammar ${{ matrix.os }} 
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup MSYS2
        if: matrix.os == 'windows-latest' 
        uses: msys2/setup-msys2@v2
        with:
          msystem: MINGW64
          path-type: inherit
          update: false
          install: >-

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"

      - name: Install Python dependencies
        run: python -m pip install lark[interegular] pyright jsonschema

      - name: Run grammar check
        run: python grug_grammar.py

      - name: Run JSON schema validation
        run: python mod_api_schema.py

      - name: Run Pyright type check
        run: |
          PY_MAJOR_MINOR=$(python - <<'EOF' | tr -d '\r'
          import sys
          print(f"{sys.version_info.major}.{sys.version_info.minor}")
          EOF
          )
          pyright --pythonversion "$PY_MAJOR_MINOR"

        env:
          SHUFFLES: 10