Skip to content

Commit afe5513

Browse files
committed
gha - add windows runner in test
And use some common actions that handle multiple OSes setup
1 parent 4c71dbc commit afe5513

File tree

1 file changed

+15
-39
lines changed

1 file changed

+15
-39
lines changed

.github/workflows/test-suite.yml

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
test-suite:
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, macos-latest]
16+
os: [ubuntu-latest, macos-latest, windows-latest]
1717
runs-on: ${{ matrix.os }}
18-
18+
1919
name: Run test suite
2020
if: github.repository == 'quarto-dev/quarto-markdown'
21-
21+
2222
steps:
2323
- name: Checkout Repo
2424
uses: actions/checkout@v4
@@ -33,8 +33,8 @@ jobs:
3333
if: runner.os == 'macOS'
3434
uses: dtolnay/rust-toolchain@nightly
3535

36-
- name: Set up Rust nightly (Linux)
37-
if: runner.os == 'Linux'
36+
- name: Set up Rust nightly (using rustup)
37+
if: runner.os == 'Linux' || runner.os == 'Windows'
3838
run: rustup override set nightly
3939
shell: bash
4040

@@ -43,50 +43,26 @@ jobs:
4343
shell: bash
4444

4545
# Pandoc setup
46-
- name: Set up Pandoc (Linux)
47-
if: runner.os == 'Linux'
48-
run: |
49-
curl -LO https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-1-amd64.deb
50-
sudo dpkg -i pandoc-3.7.0.2-1-amd64.deb
51-
shell: bash
52-
53-
- name: Set up Pandoc (macOS)
54-
if: runner.os == 'macOS'
55-
run: |
56-
brew install pandoc
57-
shell: bash
46+
- name: Install pandoc
47+
uses: pandoc/actions/setup@v1
5848

59-
# tree-sitter setup
60-
- name: Set up tree-sitter CLI (Linux)
61-
if: runner.os == 'Linux'
62-
run: |
63-
sudo apt-get update
64-
sudo apt-get install libc6-dev
65-
sudo apt-get install gcc-multilib
66-
curl -LO https://github.com/tree-sitter/tree-sitter/releases/download/v0.25.8/tree-sitter-linux-x86.gz
67-
gunzip tree-sitter-linux-x86.gz
68-
chmod +x tree-sitter-linux-x86
69-
sudo mv tree-sitter-linux-x86 /usr/local/bin/tree-sitter
70-
71-
- name: Set up tree-sitter CLI (macOS)
72-
if: runner.os == 'macOS'
73-
run: brew install tree-sitter-cli
74-
shell: bash
49+
# tree-sitter CLI setup
50+
- uses: tree-sitter/setup-action@v2
51+
with:
52+
install-lib: false
7553

7654
# build and run tests
7755
- name: Build
7856
run: cargo build
7957
shell: bash
8058

8159
- name: Test inline tree-sitter grammar
82-
run: |
83-
cd crates/tree-sitter-qmd/tree-sitter-markdown-inline
84-
tree-sitter test
60+
working-directory: crates/tree-sitter-qmd/tree-sitter-markdown-inline
61+
run: tree-sitter test
8562

8663
- name: Test block tree-sitter grammar
87-
run: |
88-
cd crates/tree-sitter-qmd/tree-sitter-markdown
89-
tree-sitter test
64+
working-directory: crates/tree-sitter-qmd/tree-sitter-markdown
65+
run: tree-sitter test
9066

9167
- name: Test Rust code
9268
run: cargo test

0 commit comments

Comments
 (0)