Repository navigation
106 lines (88 loc) · 3.03 KB
/
Copy pathtest.yml
File metadata and controls
106 lines (88 loc) · 3.03 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
name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
run_benchmarks:
description: "Run selector/scheduler benchmarks with regression thresholds"
required: false
type: boolean
default: false
schedule:
- cron: "0 3 * * *"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.92"
components: rustfmt, clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check all targets
run: cargo check --all-targets
- name: Run baseline tests
run: cargo test --all
- name: Run features compatible with MSRV
run: cargo test --features xpath,cli-examples
- name: Test explicit TL integration
run: |
cargo test --locked --features tl-parser
cargo test --locked --no-default-features --features tl-parser
cargo clippy --locked --all-targets --features tl-parser -- -D warnings
- name: Run no-default-features tests
run: cargo test --no-default-features
- name: Run examples in offline mock mode
run: ./scripts/run_examples_offline.sh
- name: Verify documentation and Markdown examples
env:
RUSTDOCFLAGS: "-D warnings"
run: |
cargo doc --locked --no-deps --features xpath,cli-examples
cargo test --locked --doc --features xpath,cli-examples
python3 scripts/check_docs.py
python3 skills/develop-silkworm/scripts/check_examples.py --repo .
- name: Run clippy
run: cargo clippy --all-targets --features xpath,cli-examples -- -D warnings
charset-detection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.98"
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Test charset detection with all features
run: cargo test --locked --all-features
- name: Test detection without DOM caching
run: cargo test --locked --no-default-features --features charset-detection
- name: Lint all features
run: cargo clippy --locked --all-targets --all-features -- -D warnings
benchmark:
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_benchmarks == 'true')
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.92"
components: rustfmt, clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run benchmark regression checks
env:
SILKWORM_BENCH_CHECK: "1"
run: cargo bench --bench core --features xpath