forked from tonarino/innernet
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (94 loc) · 2.79 KB
/
rust.yml
File metadata and controls
100 lines (94 loc) · 2.79 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
name: Rust
on:
push:
branches:
- "*"
tags-ignore:
- "v*"
pull_request:
branches:
- "*"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Dependencies (if Ubuntu)
env:
ACCEPT_EULA: Y
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-19-dev
if: contains(runner.os, 'Linux')
- uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --locked --verbose
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --locked --verbose
- name: Test (IPv6)
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --locked --features v6-test --verbose
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --locked --all-targets -- -D warnings
doc:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- name: Install System Dependencies
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-19-dev
- name: Run cargo docs-rs on all workspace members
run: |
# cargo metadata lists workspace members, jq filters them to ones that are libraries (as
# cargo docs-rs fails on bin/only crates) and extracts their names.
for pkg in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select([.targets[].kind[]] | join(" ") | test("lib|proc-macro")) | .name'); do
echo "::group::Building docs for $pkg"
cargo docs-rs -p "$pkg"
echo "::endgroup::"
done