-
Notifications
You must be signed in to change notification settings - Fork 453
109 lines (94 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
109 lines (94 loc) · 3.04 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
107
108
109
on:
pull_request:
branches: [ master ]
merge_group:
types: [ checks_requested ]
workflow_dispatch: { }
name: Continuous integration
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
crate: [petgraph, petgraph-core, petgraph-serialization-tests]
rust: [stable, beta, nightly]
include:
- rust: nightly
bench: true
name: Tests ${{ matrix.crate }} (Rust ${{ matrix.rust }})
steps:
- name: Checkout code
uses: actions/checkout@v5
# Remove repo toolchain pin so we can specify toolchain manually
- name: Remove toolchain pin
run: rm -f rust-toolchain.toml rustup-toolchain.toml
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Build caching
uses: Swatinem/rust-cache@v2
- name: Build and test
run: |
# Run tests with default and all features. Powerset of features is only tested on merge
# or with the S-run-thorough-ci-tests label to save CI resources.
cargo nextest run --package ${{ matrix.crate }} --verbose
cargo nextest run --package ${{ matrix.crate }} --all-features --verbose
- name: Build benchmarks
if: ${{ matrix.bench }}
run: |
cargo bench --verbose --no-run
cargo bench --verbose --no-run --all-features
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup just
uses: extractions/setup-just@v3
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt, clippy
- name: Build caching
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: just fmt
- name: Run clippy
# The benchmarks target require nightly,
# so we cannot use --all-targets here.
run: just clippy
- name: Build docs
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "-Dwarnings"
check-no-std:
name: Check no_std
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
# Remove repo toolchain pin so we can specify toolchain manually
- name: Remove toolchain pin
run: rm -f rust-toolchain.toml rustup-toolchain.toml
- name: Setup just
uses: extractions/setup-just@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: wasm32v1-none
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Build caching
uses: Swatinem/rust-cache@v2
- name: Check
run: just check-no-std