-
Notifications
You must be signed in to change notification settings - Fork 11
136 lines (133 loc) · 3.33 KB
/
ci.yml
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
name: ci
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test_unit:
name: Unit test main crate (1.56)
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update 1.56
rustup default 1.56
- name: "Build"
run: |
cargo build -p jotdown
- name: "Run tests"
env:
RUSTDOCFLAGS: -D warnings
run: |
cargo test -p jotdown
test_unit_all:
name: Unit test all crates (stable)
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update stable
rustup default stable
- name: "Build"
run: |
make all
cargo build --workspace --no-default-features
- name: "Run tests"
env:
RUSTDOCFLAGS: -D warnings
run: |
make check
test_html:
name: Build and run HTML tests (1.56)
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update 1.56
rustup default 1.56
- name: "Run HTML unit tests"
run: make test_html_ut
- name: "Setup node"
uses: actions/setup-node@v4
with:
node-version: 18
- name: "Compare HTML with reference implementation"
run: make test_html_ref
lint:
name: Lint (stable)
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update stable
rustup default stable
rustup component add rustfmt
rustup component add clippy
- name: "Check linting"
run: make lint
fuzz:
name: Fuzz (nightly)
strategy:
matrix:
target:
- parse
- html
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update nightly
rustup default nightly
cargo install cargo-afl
- name: "Fuzz"
run: |
echo core | sudo tee /proc/sys/kernel/core_pattern
AFL_TARGET=${{ matrix.target }} make afl_quick
bench:
name: Benchmark (stable)
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Setup toolchain"
run: |
rustup update stable
rustup default stable
sudo apt-get update
sudo apt-get install valgrind
- name: "Fetch benchmark inputs"
run: make bench
- name: "Benchmark"
run: |
cargo bench -p bench-crit all > crit
cargo bench -p bench-iai > iai
- name: "Artifact results"
uses: actions/upload-artifact@v4
with:
name: benchmark
path: |
crit
iai