-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (101 loc) · 3.21 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
name: ci
on:
push:
branches: [develop]
pull_request:
branches: [develop]
jobs:
check:
name: Check
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo check (default features)
run: RUSTFLAGS="-D warnings" cargo check
- name: cargo check (all features)
run: RUSTFLAGS="-D warnings" cargo check --all-features
- name: cargo check (all combinations of feature flags)
run: cargo install cargo-hack && cargo hack check --feature-powerset --no-dev-deps
test:
name: Test Suite
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run unit/integration tests
run: cargo test --all-features
- name: publish dry-run
working-directory: ./ndhistogram
run: cargo publish --locked --dry-run
fmt:
name: Lints
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy -- -D warnings
- name: cargo doc
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features
- name: cargo sync-readme
working-directory: ./ndhistogram
run: cargo install cargo-sync-readme && cargo sync-readme --check
- name: Setup python
uses: actions/setup-python@v4
- name: Run pre-commit hooks
run: |
pip install pre-commit \
&& pre-commit run --all-files
msrv:
name: Check minimum supported rust version
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- name: cargo check (default features)
run: cargo check
- name: cargo check (all features)
run: cargo check --all-features
minimaldependencyversion:
name: Test Suite (minimum dependency versions)
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Switch to minimal versions
run: cargo update -Zminimal-versions
- name: Run unit/integration tests
run: cargo test --all-features
coverage:
runs-on: ubuntu-latest
name: Code coverage
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests with coverage enabled
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}