Skip to content

Commit 93809a5

Browse files
committed
matrix strategy CI + update algorithm-float tests + formatting
1 parent 5d1e733 commit 93809a5

File tree

12 files changed

+51
-16
lines changed

12 files changed

+51
-16
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,30 @@ on:
77
branches:
88
- '**'
99

10+
# https://github.com/tingerrr/hydra/blob/main/.github/workflows/ci.yml
1011
jobs:
11-
ci:
12+
test-matrix:
13+
strategy:
14+
matrix:
15+
typst: [0.13.0, 0.13.1, 0.14.0]
16+
tytanic: [0.3.1]
17+
name: typst@${{ matrix.typst }} & tytanic@${{ matrix.tytanic }}
1218
runs-on: ubuntu-latest
1319
if: github.event.pull_request.draft == false
1420
steps:
1521
- uses: actions/checkout@v4
22+
- name: Install typst
23+
uses: typst-community/setup-typst@v3
24+
with:
25+
typst-version: ${{ matrix.typst }}
1626
- name: Install tytanic
17-
uses: taiki-e/cache-cargo-install-action@v2
27+
uses: typst-community/setup-tytanic@v1
1828
with:
19-
20-
- name: Run test suite
29+
tytanic-version: ${{ matrix.tytanic }}
30+
- name: Versions
2131
run: |
32+
typst --version
2233
tt --version
23-
tt run
34+
- name: Test suite
35+
run: |
36+
tt run -F

algorithmic.typ

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
let indent-list = content.map(c => c.line-indent)
7575
let max-indent = indent-list.sorted().last()
7676
let colspans = indent-list.map(i => max-indent + 1 - i)
77-
let indent-content = indent-list.map(i => ([], grid.vline(stroke: vstroke), []) * int(i / 2))
77+
let indent-content = indent-list.map(i => (
78+
([], grid.vline(stroke: vstroke), []) * int(i / 2)
79+
))
7880
let indents = (indent,) * max-indent
7981
let offset = 18pt + if indents.len() != 0 { indents.sum() }
8082
let columns = (..indents, 100% - offset)
@@ -85,7 +87,10 @@
8587
while line-number <= content.len() {
8688
if line-numbers { grid-bits.push([#line-number:]) }
8789
grid-bits = grid-bits + indent-content.at(line-number - 1)
88-
grid-bits.push(grid.cell(content.at(line-number - 1).line-content, colspan: colspans.at(line-number - 1)))
90+
grid-bits.push(grid.cell(
91+
content.at(line-number - 1).line-content,
92+
colspan: colspans.at(line-number - 1),
93+
))
8994
line-number = line-number + 1
9095
}
9196
return grid(
@@ -106,13 +111,18 @@
106111
line-numbers: true,
107112
..bits,
108113
) = {
109-
return figure(supplement: supplement, kind: "algorithm", caption: title, algorithm(
110-
indent: indent,
111-
inset: inset,
112-
vstroke: vstroke,
113-
line-numbers: line-numbers,
114-
..bits,
115-
))
114+
return figure(
115+
supplement: supplement,
116+
kind: "algorithm",
117+
caption: title,
118+
algorithm(
119+
indent: indent,
120+
inset: inset,
121+
vstroke: vstroke,
122+
line-numbers: line-numbers,
123+
..bits,
124+
),
125+
)
116126
}
117127

118128
#let iflike-unterminated(kw1: "", kw2: "", cond, ..body) = (
@@ -138,11 +148,23 @@
138148
(v,)
139149
}
140150
}
141-
#let call(name, kw: "function", inline: false, style: smallcaps, args, ..body) = (
151+
#let call(
152+
name,
153+
kw: "function",
154+
inline: false,
155+
style: smallcaps,
156+
args,
157+
..body,
158+
) = (
142159
if inline {
143160
[#style(name)\(#arraify(args).join(", ")\)]
144161
} else {
145-
iflike(kw1: kw, kw3: "end", (style(name) + $(#arraify(args).join(", "))$), ..body)
162+
iflike(
163+
kw1: kw,
164+
kw3: "end",
165+
(style(name) + $(#arraify(args).join(", "))$),
166+
..body,
167+
)
146168
}
147169
)
148170

tests/algorithm-float/ref/1.png

69 Bytes
Loading

tests/algorithm-float/ref/2.png

5 Bytes
Loading

tests/algorithm-float/ref/3.png

-42 Bytes
Loading

tests/algorithm-float/ref/4.png

49 Bytes
Loading

tests/algorithm-float/ref/5.png

88 Bytes
Loading

tests/algorithm-float/ref/6.png

-17 Bytes
Loading

tests/algorithm-float/ref/7.png

237 Bytes
Loading

tests/algorithm-float/ref/8.png

-113 Bytes
Loading

0 commit comments

Comments
 (0)