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
name: CI
on:
push:
branches:
pull_request:
branches:
jobs:
# ────────────────────────────────────────────────────────────────────────────
# Format — checks that code conforms to rustfmt
# ────────────────────────────────────────────────────────────────────────────
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: cargo fmt --check
run: cargo fmt --check
# ────────────────────────────────────────────────────────────────────────────
# Clippy — zero warnings allowed
# ────────────────────────────────────────────────────────────────────────────
clippy:
name: Clippy
runs-on: ubuntu-latest
needs: fmt
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-clippy-
- name: cargo clippy — default features
run: cargo clippy -- -D warnings
# J5 (v0.7) — activate when features are declared in Cargo.toml
# - name: cargo clippy — feature parallel
# run: cargo clippy --features parallel -- -D warnings
# - name: cargo clippy — feature serde
# run: cargo clippy --features serde -- -D warnings
# ────────────────────────────────────────────────────────────────────────────
# Test — unit and integration test suite
# ────────────────────────────────────────────────────────────────────────────
test:
name: Test
runs-on: ubuntu-latest
needs: fmt
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-test-
- name: cargo test — default features
run: cargo test
# J5 (v0.7) — activate when features are declared in Cargo.toml
# - name: cargo test — feature parallel
# run: cargo test --features parallel
# - name: cargo test — feature serde
# run: cargo test --features serde
# ────────────────────────────────────────────────────────────────────────────
# Doc — generation and deployment to GitHub Pages
# Triggered on push to main only
# ────────────────────────────────────────────────────────────────────────────
doc:
name: Documentation
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-doc-
- name: cargo doc — build with KaTeX header
run: RUSTDOCFLAGS="--html-in-header docs/katex-header.html" cargo doc --no-deps
- name: Add root redirect to oxiflow/index.html
run: |
echo '<meta http-equiv="refresh" content="0; url=oxiflow/index.html">' \
> target/doc/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
enable_jekyll: false