Repository navigation
172 lines (143 loc) · 4.76 KB
/
Copy pathtest.yml
File metadata and controls
172 lines (143 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Test
# Replaces the former AppVeyor (Windows) and GitLab CI (Linux) pipelines:
# build + run the test suite on every platform Vale ships for.
on:
push:
branches: [v3]
pull_request:
permissions:
contents: read
jobs:
# Linux and macOS differ only in where xsltproc comes from, so they share a
# job. Windows is separate: its runner image has no `make`.
unix:
name: Test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # a failure on one platform shouldn't hide the other
matrix:
include:
- { name: Linux, os: ubuntu-latest, goos: linux }
- { name: macOS, os: macos-latest, goos: darwin }
env:
CGO_ENABLED: "0"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # tags, for the version ldflag in `make build`
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
# For Asciidoctor, below -- the end-to-end suite lints AsciiDoc.
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Install documentation toolchain
run: |
# macOS ships xsltproc; Ubuntu doesn't.
if [ "${{ runner.os }}" = "Linux" ]; then
sudo apt-get -qq update
sudo apt-get install -y xsltproc
fi
python -m pip install --upgrade docutils sphinx # rst2html
gem install asciidoctor
cargo install --locked typst2vast # runners ship a Rust toolchain
curl -fsSL -o dita-ot-3.6.zip \
https://github.com/dita-ot/dita-ot/releases/download/3.6/dita-ot-3.6.zip
unzip -q dita-ot-3.6.zip
echo "$PWD/dita-ot-3.6/bin" >> "$GITHUB_PATH"
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build the grammars
run: grammars/build.sh
shell: bash
- name: Build
run: make build os=${{ matrix.goos }} exe=vale
- name: Test
run: make test
env:
VALE_E2E_STRICT: "1" # every converter above must really be present
windows:
name: Test (Windows)
runs-on: windows-latest
defaults:
run:
shell: bash # use the runner's Git bash for all steps
env:
CGO_ENABLED: "0"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
# For Asciidoctor, below -- the end-to-end suite lints AsciiDoc.
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
# The same converters the Linux job installs.
- name: Install documentation toolchain
run: |
python -m pip install --upgrade docutils sphinx # rst2html
gem install asciidoctor
cargo install --locked typst2vast # runners ship a Rust toolchain
choco install --no-progress -y xsltproc
curl -fsSL -o dita-ot-3.6.zip \
https://github.com/dita-ot/dita-ot/releases/download/3.6/dita-ot-3.6.zip
unzip -q dita-ot-3.6.zip
# A Windows path: this shell's $PWD is a POSIX one PATH can't use.
echo "$GITHUB_WORKSPACE\\dita-ot-3.6\\bin" >> "$GITHUB_PATH"
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build the grammars
run: grammars/build.sh
shell: bash
- name: Build
run: go build -o bin/vale.exe ./cmd/vale
- name: Test
run: go test ./...
env:
# Fail rather than skip if a converter above didn't install, so a
# gap in the toolchain can't pass for coverage.
VALE_E2E_STRICT: "1"
# The browser build has no CGo and no external tools, so it is its own
# target: build it, then drive its JavaScript API from Node the way a
# browser host would.
wasm:
name: Test (wasm)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
# The smoke test adds a grammar through the API; one is enough.
- name: Build a grammar
run: grammars/build.sh javascript
- name: Build and test the wasm module
run: make test-wasm