From afe5513b0e7c84f40c1e09716ce9f50120a25d65 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 7 Oct 2025 20:04:59 +0200 Subject: [PATCH 1/4] gha - add windows runner in test And use some common actions that handle multiple OSes setup --- .github/workflows/test-suite.yml | 54 +++++++++----------------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 7746a4d..8a837b0 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -13,12 +13,12 @@ jobs: test-suite: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} - + name: Run test suite if: github.repository == 'quarto-dev/quarto-markdown' - + steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -33,8 +33,8 @@ jobs: if: runner.os == 'macOS' uses: dtolnay/rust-toolchain@nightly - - name: Set up Rust nightly (Linux) - if: runner.os == 'Linux' + - name: Set up Rust nightly (using rustup) + if: runner.os == 'Linux' || runner.os == 'Windows' run: rustup override set nightly shell: bash @@ -43,35 +43,13 @@ jobs: shell: bash # Pandoc setup - - name: Set up Pandoc (Linux) - if: runner.os == 'Linux' - run: | - curl -LO https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-1-amd64.deb - sudo dpkg -i pandoc-3.7.0.2-1-amd64.deb - shell: bash - - - name: Set up Pandoc (macOS) - if: runner.os == 'macOS' - run: | - brew install pandoc - shell: bash + - name: Install pandoc + uses: pandoc/actions/setup@v1 - # tree-sitter setup - - name: Set up tree-sitter CLI (Linux) - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install libc6-dev - sudo apt-get install gcc-multilib - curl -LO https://github.com/tree-sitter/tree-sitter/releases/download/v0.25.8/tree-sitter-linux-x86.gz - gunzip tree-sitter-linux-x86.gz - chmod +x tree-sitter-linux-x86 - sudo mv tree-sitter-linux-x86 /usr/local/bin/tree-sitter - - - name: Set up tree-sitter CLI (macOS) - if: runner.os == 'macOS' - run: brew install tree-sitter-cli - shell: bash + # tree-sitter CLI setup + - uses: tree-sitter/setup-action@v2 + with: + install-lib: false # build and run tests - name: Build @@ -79,14 +57,12 @@ jobs: shell: bash - name: Test inline tree-sitter grammar - run: | - cd crates/tree-sitter-qmd/tree-sitter-markdown-inline - tree-sitter test + working-directory: crates/tree-sitter-qmd/tree-sitter-markdown-inline + run: tree-sitter test - name: Test block tree-sitter grammar - run: | - cd crates/tree-sitter-qmd/tree-sitter-markdown - tree-sitter test + working-directory: crates/tree-sitter-qmd/tree-sitter-markdown + run: tree-sitter test - name: Test Rust code run: cargo test From bc2eceea16b1a863903dc6dbdd77c002bb3b48a0 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 7 Oct 2025 20:39:32 +0200 Subject: [PATCH 2/4] fix: ensure fail-fast is set to false in test suite strategy --- .github/workflows/test-suite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 8a837b0..dc0d74d 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -12,6 +12,7 @@ on: jobs: test-suite: strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} From d8aaed96fe321c12793c7badd1bb02d6a055a845 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 7 Oct 2025 20:47:25 +0200 Subject: [PATCH 3/4] Fix Windows build by excluding fuzz targets from workspace build The fuzz crate uses #![no_main] which causes linker errors on Windows when built with `cargo build`. While Linux/Mac linkers seems to be permissive and allow this, the resulting binaries are probably non-functional. It seems fuzz targets should only be built with `cargo fuzz` as the directory README explain --- .github/workflows/test-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index dc0d74d..c996ae5 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -54,7 +54,7 @@ jobs: # build and run tests - name: Build - run: cargo build + run: cargo build --workspace --exclude quarto-markdown-pandoc-fuzz shell: bash - name: Test inline tree-sitter grammar From f8305a735ed72a9e33e9ba354fff255e405032b2 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 7 Oct 2025 20:54:23 +0200 Subject: [PATCH 4/4] ignore windows build artifacts --- .../tree-sitter-qmd/tree-sitter-markdown-inline/.gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/tree-sitter-qmd/tree-sitter-markdown-inline/.gitignore b/crates/tree-sitter-qmd/tree-sitter-markdown-inline/.gitignore index 6549918..97b280c 100644 --- a/crates/tree-sitter-qmd/tree-sitter-markdown-inline/.gitignore +++ b/crates/tree-sitter-qmd/tree-sitter-markdown-inline/.gitignore @@ -1 +1,6 @@ -markdown-inline.dylib \ No newline at end of file +markdown-inline.dylib + +# windows +*.obj +*.lib +*.exp \ No newline at end of file