From daae04f3a3f40b0a3beabe513dc1ab380b0c94e0 Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 16 Jul 2026 18:55:51 +0200 Subject: [PATCH] check for linguist compatibility in CI --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb64736..3ddc657 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,3 +72,26 @@ jobs: env: QDK_SAMPLES: ${{ github.workspace }}/qdk/samples run: npm test + + # Verifies the grammar compiles with GitHub Linguist's grammar compiler, so + # regressions (e.g. variable-length lookbehinds) are caught before they'd + # break syntax highlighting on GitHub.com. + # See https://github.com/github-linguist/linguist/issues/3924#issuecomment-2960632465 + linguist: + runs-on: ubuntu-latest + env: + REPO_PATH: qsharp-tmLanguage + steps: + - name: Checkout linguist + uses: actions/checkout@v4 + with: + repository: github-linguist/linguist + + - name: Checkout current repo/PR as submodule + uses: actions/checkout@v4 + with: + path: vendor/grammars/${{ env.REPO_PATH }} + clean: false + + - name: Compile linguist grammar + run: script/grammar-compiler add vendor/grammars/${{ env.REPO_PATH }}