-
-
Notifications
You must be signed in to change notification settings - Fork 262
163 lines (154 loc) · 4.82 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
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
name: pest Continuous Integration
on:
push:
branches:
- staging
- trying
- master
pull_request:
branches:
- staging
- trying
- master
jobs:
check:
name: cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
kind: check
toolchain: 1.74.0 # needed for `clap` in pest_debugger
- name: cargo check
run: cargo check --all --features pretty-print,const_prec_climber,memchr,grammar-extras --all-targets
testing:
name: Unit, Style, and Lint Testing
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
components: clippy, rustfmt
toolchain: 1.74.0 # needed for `clap` in pest_debugger
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all --features pretty-print,const_prec_climber,memchr,grammar-extras --all-targets -- -Dwarnings
- name: cargo test
run: cargo test --all --features pretty-print,const_prec_climber,memchr,grammar-extras --release
- name: cargo test (ignored)
run: cargo test -p pest_grammars --lib --verbose --release -- --ignored tests::toml_handles_deep_nesting_unstable
doc:
name: Documentation check
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
toolchain: 1.74.0 # needed for `clap` in pest_debugger
- name: cargo doc
run: cargo doc --all --features pretty-print,const_prec_climber,memchr,grammar-extras
dependency:
name: Minimal Versions Testing
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: msrv
tools: cargo-msrv
toolchain: 1.70.0 # needed for cargo-msrv due to cargo-platform v0.1.6
- name: Check msrv
shell: sh
run: for crate in "derive" "generator" "grammars" "meta" "pest" "vm"; do cd "$crate" && cargo msrv verify && cd ..; done
coverage:
name: Test Coverage
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
components: llvm-tools-preview
toolchain: stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --features pretty-print,const_prec_climber,memchr,grammar-extras --workspace --lcov --output-path lcov.info
- name: Upload Results to Codecov
uses: codecov/codecov-action@v3
with:
file: lcov.info
flags: unittests
name: pest-ci-coverage
fail_ci_if_error: false
verbose: true
hack:
name: cargo hack check --feature-powerset
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
toolchain: 1.74.0 # needed for `clap` in pest_debugger
- name: Check feature powerset
run: cargo hack check --feature-powerset --optional-deps --exclude-all-features --skip not-bootstrap-in-src,cargo --keep-going --lib --tests --ignore-private
no_std:
name: check for no_std compatibility
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
components: rust-src
toolchain: nightly-2023-12-31 # upgrade this regularly
- name: check no_std compatibility
run: cd pest && cargo build -j1 -Z build-std=core,alloc --no-default-features --target x86_64-unknown-linux-gnu
semver:
name: check for semver compatibility
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
toolchain: nightly-2023-12-31
tools: cargo-semver-checks
- name: check semver compatibility
shell: bash
run: ./semvercheck.sh