-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (91 loc) · 2.52 KB
/
rust.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
---
name: Rust
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'Cargo.toml'
- 'src/**'
- '.codespellrc'
- '.github/workflows/rust.yml'
pull_request:
branches:
- main
paths:
- 'Cargo.toml'
- 'src/**'
- '.codespellrc'
- '.github/workflows/rust.yml'
env:
CARGO_TERM_COLOR: always
jobs:
codespell:
name: Check for spelling mistakes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check format
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-features
docs:
name: Build documentation
needs:
- codespell
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build documentation
run: cargo doc --all-features --document-private-items
build-linux:
name: Build on Linux
needs:
- lint
runs-on: ubuntu-latest
strategy:
matrix:
features: [ [ "--all-features" ], [ "--no-default-features", '--features=tui' ], [ "--no-default-features", '--features=dump' ], [ "--no-default-features", '--features=analyze' ] ]
steps:
- uses: actions/checkout@v4
- name: Clippy
run: cargo clippy ${{ join(matrix.features, ' ') }}
- name: Install dependencies
run: cargo fetch
- name: Check
run: cargo check --verbose ${{ join(matrix.features, ' ') }}
- name: Build
run: cargo build --verbose ${{ join(matrix.features, ' ') }}
- name: Run regular tests
run: cargo test --tests --verbose ${{ join(matrix.features, ' ') }}
# codecov:
# name: Code Coverage
# needs:
# - lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: llvm-tools-preview
# - name: Install cargo-llvm-cov
# uses: taiki-e/install-action@cargo-llvm-cov
# uses: taiki-e/install-action@nextest
# - name: Generate code coverage
# run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4.0.1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: lcov.info
# fail_ci_if_error: true